MATLAB Answers

Convert matrix 3d into 2d

4 views (last 30 days)
Jonathan Demmer
Jonathan Demmer on 9 Dec 2019
Commented: Matt J on 9 Dec 2019
Hello all,
I have matrix (a*b*n) (3d matrix), I would like to convert it into n 2D matrix (a*b). Can someone help me, please?
Jonathan

  2 Comments

Rik
Rik on 9 Dec 2019
Do you want to just select 1 slice, sum the slices, take the mean of the slices, do something else?
Jonathan Demmer
Jonathan Demmer on 9 Dec 2019
Thank you for your answer.
I would like to create n matrix with dimension(a*b) from a 3D matrix (a*b*n). n is the temporal parameters of the 3 d matrix, I would like that each time step is in a new 2D matrix. Is that clearer?

Sign in to comment.

Answers (1)

Matt J
Matt J on 9 Dec 2019
Calling your matrix A,
Acell=num2cell(A,[1,2]);

  6 Comments

Show 3 older comments
Rik
Rik on 9 Dec 2019
Just as Matt wrote: use curly brackets.
Acell{2}
Matt J
Matt J on 9 Dec 2019
Jonathan Demmer's answer converted to a comment:
Thank you everybody, it work s well indeed...
Regards
Jonathan
Matt J
Matt J on 9 Dec 2019
You are welcome, but since it did work, please Accept-click the answer.

Sign in to comment.

Sign in to answer this question.

Tags