MATLAB Answers


i want to initialize a matrix of 3x3 to value -1 how this colud be done?

Asked by Raman
on 11 Apr 2013

M=zeros(3,3); intialize M with zeros of 3x3 but what to do if i want to initialize it with -1


-1 -1 -1
-1 -1 -1
-1 -1 -1

can anybody help me

  1 Comment

M - 1


No products are associated with this question.

1 Answer

Answer by Yao Li
on 11 Apr 2013
 Accepted answer



Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!