How to convert a 3x3xN matrix to a N element cell array?
Show older comments
Hi all,
I have a three dimension matrix of 3x3xN, where N is a large number. I want to convert it to a N elements cell array in which every cell i contains the 3x3 matrix in the i'th position. I tried to work it out using the functions 'mat2cell' and 'num2cell' but couldn't understand how to do it. I read the help for these two functions but it didn't help me.
Can it be done?
Thanks,
Alon
Accepted Answer
More Answers (1)
KSSV
on 21 Nov 2016
A = rand(3,3,100) ;
[m,n,t] = size(A) ;
iwant=mat2cell(A, m, n, ones(1,t));
1 Comment
Alon Rozen
on 21 Nov 2016
Categories
Find more on Data Type Conversion 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!