Create a nxn matrix with the same values

24 Ansichten (letzte 30 Tage)
AnnaMaria Accardo
AnnaMaria Accardo am 25 Feb. 2015
Hi all, Is there other methods to create an nxn matrix with the same values? I found a method which is
B(1:9, 1:9) = 3
that is perfect but, there is a different method?

Akzeptierte Antwort

Rick Rosson
Rick Rosson am 25 Feb. 2015
B = 3*ones(9);
  2 Kommentare
AnnaMaria Accardo
AnnaMaria Accardo am 25 Feb. 2015
ah! So easy? Sorry. I'm too stupid...
Gangadhar Venkata Ramana
Gangadhar Venkata Ramana am 7 Aug. 2021
I have been trying to multiply a scalar value to 2D matix inside the batch parallel processing.
I am unable to scale the matrix with the scalar value. An error showing, matix dimensions must agree.
Kindly suggest a solution.
Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by