I have a problem with defining some matrices in MATLAB. I get three numbers x,y,z as an input from user, then I want to create y-1 empty matrices. For example consider x = 3, y = 4, and z = 2. The required y-1 matrices M1, M2, and M3 are:
size(M1) = [3,4] ~ [x,y]
size(M2) = [4,4] ~ [y,y]
size(M3) = [4,2] ~ [y,z]
The parameters x,y are not known before running the program. If y was 5, the matrices were:
size(M1) = [3,5] ~ [x,y]
size(M2) = [5,5] ~ [y,y]
size(M3) = [5,5] ~ [y,y]
size(M4) = [5,2] ~ [y,z]
Indeed the main problem is that the number of matrices is an input. Please guide me on how I can create a function loop to define this matrices.
A=[], a zero matrix (e.g. `A = zeros(3)') still has some size.bsxfunandcellfunhowever cannot handlezeros. I'll keep digging.cell array, which will still have the benefit of matrix style indexing, or astructure, which is convenient when you need (or prefer) to name your variables.