Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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 Kommentare
KSSV
KSSV am 5 Okt. 2018
Bearbeitet: KSSV am 5 Okt. 2018
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??

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by