Create a three-dimensional matrix with dimensions 2 x 4 x 3 in which the first “layer” is all 0s, the second is all 1s and the third is all 5s. Use size to verify the dimensions
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:26.2
All Answers
total answers (1)
>> mat3d = zeros(2,4,3);
>> mat3d(:,:,2) = 1;
>> mat3d(:,:,3) = 5;
>> mat3d
mat3d(:,:,1) =
0 0 0 0
0 0 0 0
mat3d(:,:,2) =
1 1 1 1
1 1 1 1
mat3d(:,:,3) =
5 5 5 5
5 5 5 5
need an explanation for this answer? contact us directly to get an explanation for this answer