MATLAB Answers

Convert 3D matrix to 2D matrix.

8 views (last 30 days)
Aniya
Aniya on 19 Oct 2016
Commented: Aniya on 19 Oct 2016
If i have value of x,y,z plane in 3D matrix and i want to change the 3D to 2D array( of each x plain).

  0 Comments

Sign in to comment.

Accepted Answer

Massimo Zanetti
Massimo Zanetti on 19 Oct 2016
I try to guess from your question:
%random 3D array
A=rand(5,6,7);
%extract a 2D matrix from first dimension of A
x=1; % x can be from 1 to 5 in this example
B=A(x,:,:)

  1 Comment

Aniya
Aniya on 19 Oct 2016
Thank you Massimo.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags