Ploting graph on matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
cikalekli
am 18 Mai 2021
Bearbeitet: cikalekli
am 19 Mai 2021
Hi I just want to plot this equation on matlab and plot the graph for finding the type of its graph too.
here is my code but it didn't work well:
clc, close all
t = 0:1:100000;
ic = -30000*t.*exp(-5000*t) + 6*exp(-5000*t);
figure(1);clf;
plot(t, ic);
xlabel('\bf\it Time ', 'fontsize', (25)),
ylabel('\bf\it Amplitude', 'fontsize', (25)),
0 Kommentare
Akzeptierte Antwort
Star Strider
am 18 Mai 2021
The function declines very rapidly, so use a different value for ‘t’ —
% t = 0:1:100000;
t = linspace(0, 2E-3, 500);
ic = -30000*t.*exp(-5000*t) + 6*exp(-5000*t);
figure(1)%;clf;
plot(t, ic);
xlabel('\bf\it Time ', 'fontsize', (25)),
ylabel('\bf\it Amplitude', 'fontsize', (25)),
Also, the clf call immediately clears ‘figure(1)’ after creating it. The plot call regenerates it so nothing is actually lost, however it is inefficient to create it, clear it, then create it again.
4 Kommentare
Star Strider
am 18 Mai 2021
Thank you!
As always, my pleasure! Please take good care of yourself as well!
You appear to be learning MATLAB quickly!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots 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!