why i get error?

2 次查看(过去 30 天)
razzz
razzz 2014-1-1
M_0=1;
EI=1;
fi=-pi:pi/300:pi;
C5=M_0/(2*EI);
gama=exp(i*fi);
delta_0=4+2*cos(fi);
C_2= [0 ;
-C5*L*gama./delta_0;
C5*(2*gama+1)./delta_0;
-C5*(gama+1)./(L*delta_0)];
I GET:
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
Error in ==> intgration_for_v_for_loop_chek at 47
C_2= [0 ;

采纳的回答

Wayne King
Wayne King 2014-1-1
编辑:Wayne King 2014-1-1
Is this what you want?
M_0=1;
L = 1;
EI=1;
fi=-pi:pi/300:pi;
C5=M_0/(2*EI);
gama=exp(i*fi);
delta_0=4+2*cos(fi);
C_2= [zeros(size(delta_0)) ;
-C5*L*gama./delta_0;
C5*(2*gama+1)./delta_0;
-C5*(gama+1)./(L*delta_0)];
You did not tell us what L was, so I just used 1.

更多回答(1 个)

Image Analyst
Image Analyst 2014-1-1
In the first row you have only a single zero 0. But the second row, -C5*L*gama./delta_0, has as many elements as gama, which has as many elements as fi, which is 601. You can't have 1 element in row 1 and 601 elements in rows 2, 3, and 4. To fix, use as many elements in row 1 as the other rows, like Wayne showed you.

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by