Info
This question is closed. Reopen it to edit or answer.
how to use a 6-D matrix to store a cell element in this case
1 view (last 30 days)
Show older comments
Dear Friends,
JJM=cell(length(X1),1);
parfor ii=1:length(X1)
for kk=1:length(X2)
for jj=1:length(X3)
for mm=1:length(X4)
for nn=1:length(X5)
for qq=1:length(X6)
V=[X1(ii),X2(kk),X3(jj),X4(mm),X5(nn),X6(qq)];
JJM{ii}(kk,jj,mm,nn,qq)=objfun(V);
end
end
end
end
end
end
As I shown in the above code, JJM is a cell element(11 x 5-D), after the calculation, I want to use a 6-D (11 x 11 x 11 x 11 x 11 x 11) matrix to store the cell element, how can I do this? I mean if to use for-loop, it will be
for ii=1:numel(JJM)
JJM1(ii,:,:,:,:,:) =JJM{ii};
end
however, I try to use it, but there is error message, I also try
JJM1 = reshape((cell2mat(JJM))',[size(JJM{1}) numel(JJM)]);
it can't work too, is there anyone can help me? thanks
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!