Plot graph on matlab

8 ビュー (過去 30 日間)
Bhumika Kushboo Beeharry
Bhumika Kushboo Beeharry 2018 年 11 月 14 日
回答済み: Steven Lord 2018 年 11 月 14 日
Hello, each time I am trying to plot a graph on matlab online I am having a blank graph as per attachment for y=(exp(x)/sin(x))+0.3 with a range of -10 <x<10Capture.JPG

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 14 日
syms x
y=(exp(x)/sin(x))+0.3
fplot(y,[-10 10])

その他の回答 (1 件)

Steven Lord
Steven Lord 2018 年 11 月 14 日
To divide each element of exp(x) by the corresponding element of sin(x), use the ./ operator instead of the / operator. The extra period is important. See this documentation page for a description of the difference.
Because exp(x) for those negative x values is going to be small but exp(x) for those positive x values is going to be large, and because you're using a very coarse grid of x values, there's not a whole lot of detail in the left part of that plot. Maybe you should plot the portion of the graph for negative x on one axes (maybe a subplot axes) and plot the portion of the graph for positive x on a different axes.

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by