transforming some cells having 2-dimensional matrics to 3-dimensional matrics
Show older comments
Hi all I have a variable named “A” which is in cell format as following:
A=cell(4,3);
A{:,:}=ones(16,5);
<16x5 double> <16x5 double> <16x5 double>
<16x5 double> <16x5 double> <16x5 double>
<16x5 double> <16x5 double> <16x5 double>
<16x5 double> <16x5 double> <16x5 double>
I want to transform each cell to a 3-dimensional matrix like following:
A{1,1}(:,:,1)=[
0.555 0.759 0.099 0.303 0.445
0.880 0.473 0.308 0.343 0.729
NaN NaN NaN NaN NaN
0.701 0.606 0.736 0.709 0.172 ];
A{1,1}(:,:,2)=[
0.594 0.355 0.023 0.213 0.473
0.847 0.118 0.272 0.589 0.905
0.853 0.018 0.373 NaN 0.932
0.093 0.136 0.420 0.996 0.509];
A{1,1}(:,:,3)=[
0.530 0.227 0.802 0.645 0.240
NaN 0.541 0.087 0.501 0.592
0.518 0.019 0.286 0.182 0.473
0.050 0.015 0.851 0.056 0.647];
A{1,1}(:,:,4)=[
0.345 0.174 0.131 0.557 0.829
0.940 0.329 0.878 0.289 0.081
0.309 NaN 0.166 0.766 0.082
0.521 0.275 0.820 0.245 0.244];
How can I do this, any help would appreciate
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!