From a vector to a 3D array
Show older comments
I would like to create a 3D array from a vector. As an example, the size of the could be 6x5x4 and the vector is 120x1.
I tried to reshape function but the elements order of the array "result" are not correct
I copied the solution that I should obtain for the array result for a (:,:,1)
% result(:,:,1) =
Columns 1 through 4
0.353158571222071 0.73172238565867 0.188955015032545 0.0811257688657853
0.821194040197959 0.647745963136307 0.686775433365315 0.92938597096873
0.0154034376515551 0.450923706430945 0.18351115573727 0.775712678608402
0.0430238016578078 0.547008892286345 0.368484596490336 0.486791632403172
0.168990029462704 0.296320805607773 0.62561856072969 0.435858588580919
0.649115474956452 0.744692807074156 0.780227435151377 0.446783749429806
Column 5
0.306349472016557
0.508508655381127
0.51077156417211
0.817627708322262
0.794831416883453
0.644318130193692
I attached the vector file.
1 Comment
Accepted Answer
More Answers (1)
Categories
Find more on Data Types 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!