??? Error using ==> vertcat CAT arguments dimensions are not consistent.

Am running a matlab code which needs input a matrix. its showing me error like here:
??? Error using ==> vertcat CAT arguments dimensions are not consistent for following:
F=[F11 F12 F13;F21 F22 F23;F31 F32 F33]
here F11, F12 .....are elements of the matrix F

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 6 月 21 日

0 投票

One of the rows [F21 F22 F23] or [F21 F22 F23] or [F31 F32 F33] does not have the same number of columns as the other.
One of the ways this could happen is if one of the elements is empty when the others are not.

2 件のコメント

samit kumar gupta
samit kumar gupta 2012 年 6 月 21 日
I give u the full code..its shows error at line marked #
%TWO SOLITON INTERACTION
E1=0.1+0.7*i;
E2=-0.1+0.4*i;
x=-5:0.2:5;
t=0:0.1:5;
O1=-i*E1*x-2*i*E2*E2*t;
O2=-i*E2*x-2*i*E2*E2*t;
C1=1;
C2=1;
F11=0;
F12=exp(-conj(O1));
F13=exp(-conj(O2));
F21=C1*exp(O1);
F22=1/(conj(E1)-E1)*(exp(-O1-conj(O1))+conj(C1)*C1*exp(O1+conj(O1)));
F23=1/(conj(E1)-E2)*(exp(-O2-conj(O1))+conj(C1)*C2*exp(O2+conj(O1)));
F31=C2*exp(O2);
F32=1/(conj(E2)-E1)*(exp(-O1-conj(O2))+conj(C2)*C1*exp(O1+conj(O2)));
F33=1/(conj(E2)-E2)*(exp(-O2-conj(O2))+conj(C2)*C2*exp(O2+conj(O2)));
# F=[F11 F12 F13;F21 F22 F23;F31 F32 F33];
DetF=det(F);
M11=F22;
M12=F23;
M21=F32;
M22=F33;
M=[M11 M12;M21 M22];
DetM=det(M);
u(x,t)=-2*i*(DetF/DetM);
waterfall(x,t,abs(u));
colormap([0 0 0]);view(10,60)
text(-2,-6,'x','fontsize',15)
text(50, 5 ,'t','fontsize',15)
zlabel('|u|','fontsize',15)
%axis([-L/2 L/2 0 tmax 0 1]);
grid off
set(gca,'XTick',[-40 -20 0 20 40])
set(gca,'YTick',[0 10 20])
set(gca,'ZTick',[0 1 3])
Walter Roberson
Walter Roberson 2012 年 6 月 21 日
Your F11 is a scalar 0, but all of your other F are row vectors of size 1 x 53.
You need
F11 = zeros(size(t));

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

質問済み:

2012 年 6 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by