MATLAB: Variable order matrix with some constant value entry

matricesmatrixmatrix manipulation

How to make a matrix with all entries of -1 with a desired order. I want to make a matrix L= [-1 ;-1 ;-1], but size of L is another variable. i.e. I want L = -1 of size (x,y)

Best Answer

L = -1 * ones(x, y);
Related Question