Merging calculated solution elements cell arrays into a single column cell array
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear All,
Please, I have a major issue which I would greatly appreciate some assistance. I have calculated a 3x1x108 cell array solution. Each of the 108 elements is a numeric array with dimensions ranging from val (:,:,1) to val (:,:,108). I would like to merge all the calculated element’s solution into a single 3x1 column array.
Thank you so much for your help.
Val (:,:,1) = 1.0e+04 *
0.000000022979506 - 0.000000036470490i
0.002185443408772 - 0.052463050512697i
2.289129333615808 + 5.029468816352341i
Val (:,:,2) = 1.0e+04 *
-0.000001404857395 + 0.000002447418100i
-0.021924555135876 - 0.020324520317864i
1.557775455827619 + 0.915119490385055i
Val (:,:,3) = 1.0e+04 *
-0.000003885746464 - 0.000002190311736i
-0.534013981410952 - 0.242903162743672i
1.943318570895146 + 2.219598861090568i
Val (:,:,108) = 1.0e+04 *
-0.000000014195745 - 0.000000010788638i
-2.278194863009318 + 0.437249050543058i
1.969494482063662 + 0.559354184163361i
댓글 수: 0
채택된 답변
Mohammad Sami
2021년 6월 24일
You can try using cell2mat to convert the cells into a matrix.
a = num2cell(randi(3,[3 1 108]));
b = cell2mat(a);
b = permute(b,[3 1 2]);
b
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!