Getting an Error "Error using vertcat Dimensions of matrices being concatenated are not consistent." in my Matlab program. Please help.

1 回表示 (過去 30 日間)
for aa=1:61;
xx=(aa-1)*l; %%Horizontal ordinate
ff=1:61;
yy=[ff; (ff-1)*l];
yyy=yy';
for vv=1:61;
ww=(vv-1)*0; %%Horizontal ordinate
uu=1:61;
bbb=[uu; (uu-1)*0];
bbbb=bbb';
for pp=1:61;
zz=sqrt(R^2-((L/2)-(pp-1)*l)^2)-(R-Oo);
gg=1:61;
qq=[gg; sqrt(R.^2-((L/2)-(gg-1)*l).^2)-(R-Oo)];
qqq=qq';
%%Output file for upper curve element axis
fid = fopen('Mymatrix2.txt','wt');
for ii = 1:size(yy,1);
fprintf(fid,'%g\t',yyy(ii,:));
fprintf(fid,'\n');
end
for jj = 1:size(bbb,1);
fprintf(fid,'%g\t',bbbb(jj,:));
fprintf(fid,'\n');
end
for kk = 1:size(qq,1);
fprintf(fid,'%g\t',qqq(kk,:));
fprintf(fid,'\n');
end
fclose(fid);
end
end
end
AA=[yy bbb qq]
B=arrayfun(@(x) num2str(x) , AA,'uni',0)
BB=[{'array1','array2','array3'};B] (ERROR HERE)
dlmcell('test.txt',BB)
Error using vertcat Dimensions of matrices being concatenated are not consistent.
Error in massinput (line 127) BB=[{'array1','array2','array3'};B]
  2 件のコメント
KSSV
KSSV 2018 年 10 月 5 日
編集済み: KSSV 2018 年 10 月 5 日
Put in debug mode and check the dimensions of each variable at that line...they are not compatible to join.
Your inputs array1 etc..are strings I guess.....why you want to join them with B??
madhan ravi
madhan ravi 2018 年 10 月 5 日
編集済み: madhan ravi 2018 年 10 月 5 日
Whats L?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by