MATLAB Answers

Raman

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

i.e

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

can anybody help me

  1 Comment

Andrei Bobrov
on 11 Apr 2013
M - 1

Products

No products are associated with this question.

1 Answer

Answer by Yao Li
on 11 Apr 2013
 Accepted answer
-ones(3,3)

  0 Comments


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today