Style Property Not Being Recognised
Hi all,
I am trying to format a table – border, border colour etc. I am trying to do this programmatically from the Mathwoks page here: https://uk.mathworks.com/help/rptgen/ug/format-tables.html#mw_aa27b9a4-0c98-4bd7-a08d-2bfa3dda0411
However, I keep getting a error saying "The class table has no Constant property or Static method named ‘Style’."
From the web page I would input something like this:
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
But the above error message is being shown.
Here is my code. I am only interested in formatting the table, so sorry for so much code.
%Structural Properties
E = 2.1E+08;
Ic1 = 22530/100^4;
Ic2 = 14270/100^4;
Ic3 = 5259/100^4;
Ib = 16040/100^4;
Ac1 = 168/100^2;
Ac2 = 113.3/100^2;
Ac3 = 66.28/100^2;
H = 21;
h = 3;
w = 12.7;
% Average second moment of area of coluums
Ic = (2*Ic1 + 2*Ic2 + 3*Ic2)/7
% Average cross-sectional area of columns
Ac = (2*Ac1 + 2*Ac2 + 3*Ac3)/7
% Stiffness of columns of bracing unit 1
Kc1 = 4*12*E*Ic/h^2
% Stiffness of beams
Kb1 = 2*12*E*Ib/(9*h) + 12*E*Ib/(2*h)
% Reduction factor
r1 = Kc1/(Kb1+Kc1)
% Stiffness of one sub-frame
K1 = (1/Kc1 + 1/Kb1)^-1
% Global second moment of area
Ig1 = 2*Ac*1^2 + 2*Ac*10^2
% Second moment of area of one column
I1 = 4*r1*Ic
% Total second moment of area for bending stiffness
If1 = I1 + Ig1
% Parameter kappa
kappa1 = sqrt(K1/(E*I1))
% Parameter kappa*H
kappaH1 = kappa1*H
% deflection due to shear
ys1 = w*H^2/(2*K1)
% deflection due to bending
yb1 = w*H^4/(8*E*If1)
% Deflection due to interaction of shear and bending
yr1 = (w*E*I1)/(K1^2)*(1 + kappaH1*sinh(kappaH1)/(cosh(kappaH1)-1))
% Total deflection
y1 = ys1 + yb1 – yr1
Bracing_Unit1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Bracing_Unit2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
% Set up table
Labels = {‘Column Stiffness’,’Beam Stiffness’,’Frame Stiffness’,’Global Second moment of Area’,’Shear Deflection’,’Bending Deflection’,’Shear/Bending Interaction’,’Total Deflection’};
T = table(Bracing_Unit1,Bracing_Unit2,Core_1,Core_2,’RowNames’,Labels)
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
Can someone help please?
Many thanks,
ScottHi all,
I am trying to format a table – border, border colour etc. I am trying to do this programmatically from the Mathwoks page here: https://uk.mathworks.com/help/rptgen/ug/format-tables.html#mw_aa27b9a4-0c98-4bd7-a08d-2bfa3dda0411
However, I keep getting a error saying "The class table has no Constant property or Static method named ‘Style’."
From the web page I would input something like this:
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
But the above error message is being shown.
Here is my code. I am only interested in formatting the table, so sorry for so much code.
%Structural Properties
E = 2.1E+08;
Ic1 = 22530/100^4;
Ic2 = 14270/100^4;
Ic3 = 5259/100^4;
Ib = 16040/100^4;
Ac1 = 168/100^2;
Ac2 = 113.3/100^2;
Ac3 = 66.28/100^2;
H = 21;
h = 3;
w = 12.7;
% Average second moment of area of coluums
Ic = (2*Ic1 + 2*Ic2 + 3*Ic2)/7
% Average cross-sectional area of columns
Ac = (2*Ac1 + 2*Ac2 + 3*Ac3)/7
% Stiffness of columns of bracing unit 1
Kc1 = 4*12*E*Ic/h^2
% Stiffness of beams
Kb1 = 2*12*E*Ib/(9*h) + 12*E*Ib/(2*h)
% Reduction factor
r1 = Kc1/(Kb1+Kc1)
% Stiffness of one sub-frame
K1 = (1/Kc1 + 1/Kb1)^-1
% Global second moment of area
Ig1 = 2*Ac*1^2 + 2*Ac*10^2
% Second moment of area of one column
I1 = 4*r1*Ic
% Total second moment of area for bending stiffness
If1 = I1 + Ig1
% Parameter kappa
kappa1 = sqrt(K1/(E*I1))
% Parameter kappa*H
kappaH1 = kappa1*H
% deflection due to shear
ys1 = w*H^2/(2*K1)
% deflection due to bending
yb1 = w*H^4/(8*E*If1)
% Deflection due to interaction of shear and bending
yr1 = (w*E*I1)/(K1^2)*(1 + kappaH1*sinh(kappaH1)/(cosh(kappaH1)-1))
% Total deflection
y1 = ys1 + yb1 – yr1
Bracing_Unit1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Bracing_Unit2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
% Set up table
Labels = {‘Column Stiffness’,’Beam Stiffness’,’Frame Stiffness’,’Global Second moment of Area’,’Shear Deflection’,’Bending Deflection’,’Shear/Bending Interaction’,’Total Deflection’};
T = table(Bracing_Unit1,Bracing_Unit2,Core_1,Core_2,’RowNames’,Labels)
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
Can someone help please?
Many thanks,
Scott Hi all,
I am trying to format a table – border, border colour etc. I am trying to do this programmatically from the Mathwoks page here: https://uk.mathworks.com/help/rptgen/ug/format-tables.html#mw_aa27b9a4-0c98-4bd7-a08d-2bfa3dda0411
However, I keep getting a error saying "The class table has no Constant property or Static method named ‘Style’."
From the web page I would input something like this:
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
But the above error message is being shown.
Here is my code. I am only interested in formatting the table, so sorry for so much code.
%Structural Properties
E = 2.1E+08;
Ic1 = 22530/100^4;
Ic2 = 14270/100^4;
Ic3 = 5259/100^4;
Ib = 16040/100^4;
Ac1 = 168/100^2;
Ac2 = 113.3/100^2;
Ac3 = 66.28/100^2;
H = 21;
h = 3;
w = 12.7;
% Average second moment of area of coluums
Ic = (2*Ic1 + 2*Ic2 + 3*Ic2)/7
% Average cross-sectional area of columns
Ac = (2*Ac1 + 2*Ac2 + 3*Ac3)/7
% Stiffness of columns of bracing unit 1
Kc1 = 4*12*E*Ic/h^2
% Stiffness of beams
Kb1 = 2*12*E*Ib/(9*h) + 12*E*Ib/(2*h)
% Reduction factor
r1 = Kc1/(Kb1+Kc1)
% Stiffness of one sub-frame
K1 = (1/Kc1 + 1/Kb1)^-1
% Global second moment of area
Ig1 = 2*Ac*1^2 + 2*Ac*10^2
% Second moment of area of one column
I1 = 4*r1*Ic
% Total second moment of area for bending stiffness
If1 = I1 + Ig1
% Parameter kappa
kappa1 = sqrt(K1/(E*I1))
% Parameter kappa*H
kappaH1 = kappa1*H
% deflection due to shear
ys1 = w*H^2/(2*K1)
% deflection due to bending
yb1 = w*H^4/(8*E*If1)
% Deflection due to interaction of shear and bending
yr1 = (w*E*I1)/(K1^2)*(1 + kappaH1*sinh(kappaH1)/(cosh(kappaH1)-1))
% Total deflection
y1 = ys1 + yb1 – yr1
Bracing_Unit1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Bracing_Unit2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_1 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
Core_2 = [Kc1 Kb1 K1 Ig1 ys1 yb1 yr1 y1]’
% Set up table
Labels = {‘Column Stiffness’,’Beam Stiffness’,’Frame Stiffness’,’Global Second moment of Area’,’Shear Deflection’,’Bending Deflection’,’Shear/Bending Interaction’,’Total Deflection’};
T = table(Bracing_Unit1,Bracing_Unit2,Core_1,Core_2,’RowNames’,Labels)
table.Style = [table.Style {Border(‘solid’,’black’,’3px’)}]
Can someone help please?
Many thanks,
Scott formatting table error message MATLAB Answers — New Questions