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??

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by