Error using table (line 253)
Mostrar comentarios más antiguos
% Full vehicle parameters
R_AV = 0.3; % wheel radius (m),
M_AV = 1626; % Mass(kg)
L_AV = 3.0; % length(m)
Je_AV = 4.5; % M.O.I engine(kg m2)
Cd_AV = 0.29; % Drag efficient
Crr_AV = 0.01; % Rolling Resistance
AF_AV = 1.8; % Frontal areaof vehicle (m)
W_AV = 1.6; % Width of the vehicle (m)
% Analysis of 1:8 ratio scale factor of dimensionless Radius
% 1/8 = r/R;
r_sv = R_AV*1/8;
r25_sv = R_AV*1/25;
% Analysis of sv LENGTH
% 1/8 = l/L;
l_sv = L_AV*1/8;
l25_sv = L_AV*1/25;
pi_AV = R_AV/L_AV;
pi_SV = r_sv/l_sv;
pi_SV25 = r_sv/l_sv;
Radius = [R_AV; r_sv; r25_sv];
length = [L_AV; l_sv; l25_sv];
Mode = {'Actual Vehicle' 'scaled vehicle 1:8''scaled vehicle 1:25'};
Pi = [pi_AV;pi_SV;pi_SV25];
T = table(Mode,Radius,length,Pi)
i want to display the table with the content above. but i face a problem like,
Error using table (line 253) All variables must have the same number of rows.
Error in SV (line 37) T = table(Radius,length,Pi...
Respuesta aceptada
Más respuestas (1)
Alexandra Harkai
el 15 de Nov. de 2016
Did you check how Mode looks like? It is a row array with 2 elements, which is not compatible with the 3-element column vectors in the table.
Mode = {'Actual Vehicle' 'scaled vehicle 1:8' 'scaled vehicle 1:25'}'
Notice the space between the last two elements, this will ensure . Mode is also transposed to be a column just like Radius, length, Pi.
1 comentario
Guillaume
el 15 de Nov. de 2016
Or yes, maybe Mode is meant to be a column of a 3x4 table, in which case as Alexandra says transpose the (corrected) variable.
In that case it would be a good idea to give explicit names to the columns instead of the default Var1, Var2, ..., using the 'VariableNames' syntax I've shown.
Categorías
Más información sobre Modeling Basics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!