Azzera filtri
Azzera filtri

Plotting decimals in matlab?

2 visualizzazioni (ultimi 30 giorni)
Jim Case
Jim Case il 21 Ago 2015
Risposto: Tamfor Dulin il 21 Ago 2015
I am practicing matlab and this is a simple code:
x = 0:20:120; y = [2.5:3.8:4.5:4.8:4.9:5.0:5.0]; plot(x,y)
I am getting a parse error incorrect usage at y, why?

Risposte (1)

Tamfor Dulin
Tamfor Dulin il 21 Ago 2015
Use comma (,) instead of colons (:)
like so
x = 0:20:120; y = [2.5,3.8,4.5,4.8,4.9,5.0,5.0]; plot(x,y)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by