Difference between x = 0:0.1:2*pi and linspace(0,2*pi,0.1)
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dhairya
am 13 Nov. 2022
Kommentiert: Dhairya
am 13 Nov. 2022
i was going through a matlab code and it had x = 0:0.1:2*pi written
i wanted to ask what is the difference between this and linspace and how it is used?
0 Kommentare
Akzeptierte Antwort
David Hill
am 13 Nov. 2022
Linspace divides the interval into the exact number specified, while colon notation just keeps increasing the interval by the middle number not to exceed the last number.
x=0:.1:2*pi
y=linspace(0,2*pi,63)
See the difference.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Animation 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!