Defining a square matrix
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maroulator
am 10 Dez. 2014
Beantwortet: Star Strider
am 10 Dez. 2014
I have an array b=1:0.1:10.9 which I am trying to enter into a 10X10 square matrix. I have managed the following solution, however, I can see this having some issues should I choose to have a large array and square matrix. Is there a simpler way to accomplish what I do with the following code? Thanks in advance.
a=zeros(10,10); b=1:0.1:10.9;
for i=1:100 a(i)=b(i); end
0 Kommentare
Akzeptierte Antwort
Star Strider
am 10 Dez. 2014
This works:
b=1:0.1:10.9;
B = reshape(b,10,10);
‘B’ is the matrix.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Elementary Math 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!