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

2 次查看(过去 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]

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by