How to plot y for a range of T values

8 ビュー (過去 30 日間)
Saud Almarzooqi
Saud Almarzooqi 2020 年 2 月 12 日
コメント済み: darova 2020 年 2 月 12 日
Hi
I'm very new to matlab, and I'm having trouble plotting a graph of an equation
The equation is
y = e - (a*T^2)/(T + b)
Where the values of e, a, and b are constants.
The only varialbe I have is T. I want to plot y for a range of T values from 0 to 600. But whenever I input this equation in matlab, it calculates y to be a single value, 1.1019 and this is depressing me. How can I get the plot i'm trying to find?
Thanks
  1 件のコメント
darova
darova 2020 年 2 月 12 日
Please attach your code

サインインしてコメントする。

回答 (1 件)

fred  ssemwogerere
fred ssemwogerere 2020 年 2 月 12 日
Hello, you could create an anonymous function and pass the values of "T" through this anonymous function. Watchout for the elementwise operations below:
myfunc=@(x) e-(a.*x.^2)./(x+b);
y=myfunc(T); % this will output an array with each value in "y" corresponding to a value in "T"
  1 件のコメント
Saud Almarzooqi
Saud Almarzooqi 2020 年 2 月 12 日
Thanks!!

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by