How to graph/plot this equation in MATLAB

조회 수: 4 (최근 30일)
Zainab Sayed Hassan
Zainab Sayed Hassan 2019년 11월 15일
답변: Raunak Gupta 2019년 11월 18일
How to graph/plot this equation in MATLAB
y(t)= 5e^(−t/300)
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 11월 15일
MATLAB has no implicit multiplication: you must use explicit multiplication, typically the .* operator
MATLAB uses exp(value) for e^value
Muhammad Usman
Muhammad Usman 2019년 11월 16일
It's quite easy to do, define an array for 't' and then write your equation by keeping in mind the multiplication rule described by Walter Roberson and simply use plot command

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

답변 (1개)

Raunak Gupta
Raunak Gupta 2019년 11월 18일
Hi,
For plotting the graph of some function/equation you are required to give an interval on which the function value is displayed. You may use fplot for plotting graph of a function.
Following command might help.
fplot(@(t) 5*exp(-t/300),[0,10],'MeshDensity',500);
Here the first part is the function you want to plot, second is for the range you plot it for and MeshDensity represents the number of points for which the function is evaluated. As per the documentation, for a ‘MeshDensity’ of 500 total number of evaluations are 999.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by