Ploting graph on matlab

조회 수: 1 (최근 30일)
cikalekli
cikalekli 2021년 5월 18일
편집: cikalekli 2021년 5월 19일
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)),

채택된 답변

Star Strider
Star Strider 2021년 5월 18일
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
cikalekli
cikalekli 2021년 5월 18일
편집: cikalekli 2021년 5월 18일
You clearly demonstrated and answered perfectly all of my questions and I purely understood what you meant.
Yeah, now I've just seen that the curve has been set with 0 to 2ms I got it when you wrote this.
Please take care of yourself and I will continue working on my matlab skills after that :)
Thank you ^_^
Star Strider
Star Strider 2021년 5월 18일
Thank you!
As always, my pleasure! Please take good care of yourself as well!
You appear to be learning MATLAB quickly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by