EMERGENCY Cannot plot "10,000*exp(-10000*t);"

1 Ansicht (letzte 30 Tage)
Michael Ferguson
Michael Ferguson am 12 Okt. 2017
Kommentiert: Jan am 12 Okt. 2017
t = linspace(0,0.001,100);
Impulse = 10,000*exp(-10000*t);
plot(t,Impulse,'r','LineWidth',3);
The plot comes up blank. Why?

Akzeptierte Antwort

James Tursa
James Tursa am 12 Okt. 2017
Bearbeitet: James Tursa am 12 Okt. 2017
Because you used a comma to define the 10000, and MATLAB sees that comma as a statement separator. MATLAB interprets this line
Impulse = 10,000*exp(-10000*t);
as two separate statements
Impulse = 10
000*exp(-10000*t);
Get rid of the comma.
Impulse = 10000*exp(-10000*t);

Weitere Antworten (0)

Kategorien

Mehr zu Programming 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