what is the difference between the 2 codes ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
g= zeros([2,2])
f= zeros(2,2)
0 Kommentare
Antworten (1)
James Tursa
am 8 Apr. 2021
Bearbeitet: James Tursa
am 8 Apr. 2021
zeros([2,2]) passes one argument, a 2-element vector [2,2].
zeros(2,2) passes two arguments, the scalars 2 and 2.
The result is the same, a 2x2 matrix filled with 0's.
For a square matrix result, you could also have used a single scalar argument and got the same result:
zeros(2)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!