How can I define a 3D matrix in MATLAB?
For example a matrix of size (8 x 4 x 20) or add a 3rd dimension to an existing 2D matrix?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a 3D matrix
Add a 3rd dimension to a matrix
zeros is just one way of making a new matrix. Another could be
A(1:20,1:10,1:3) = 0for a 3D matrix. To confirm the size of your matrices you can run:size(A)which gives20 10 3.There is no explicit bound on the number of dimensions a matrix may have.