Clear Filters
Clear Filters

why i get error?

2 views (last 30 days)
razzz
razzz on 1 Jan 2014
Answered: Image Analyst on 1 Jan 2014
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 ;

Accepted Answer

Wayne King
Wayne King on 1 Jan 2014
Edited: Wayne King on 1 Jan 2014
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.

More Answers (1)

Image Analyst
Image Analyst on 1 Jan 2014
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.

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!