I am writing code based on matrices chosen by the user. The user needs to define the number of rows, columns and planes the matrix has, as well as the numbers that make up the actual matrix.
So far, I have this:
'''
row=input('Enter number of rows of desired matrix');
column=input('Enter number of columns of desired matrix');
plane=input('Enter number of planes of desired matrix');
for i=1:row
for j=1:column
for k=1:plane
A(i,j,k)=input('elements-');
end
end
end
A=reshape(A,row,column,plane)
display(A)
''' This isn't exactly what I am trying to do. How would I allow the user to input its own 3-D matrix? For example, the matrix A made of 3 rows, 3 columns ands 2 planes: A(:,:,1)=[14 7 6; 9 1 12; 13 8 15] A(:,:,2)=[4 17 16; 11 10 2; 3 18 5]