MATLAB: I want to initialize a matrix of 3×3 to value -1 how this colud be done

initialize matrix with -1 value

M=zeros(3,3); intialize M with zeros of 3×3 but what to do if i want to initialize it with -1
i.e
-1 -1 -1
-1 -1 -1
-1 -1 -1
can anybody help me

Best Answer

-ones(3,3)
Related Question