Getting an empty plot

10 ビュー (過去 30 日間)
sid101
sid101 2019 年 11 月 11 日
コメント済み: sid101 2019 年 11 月 11 日
Hi, I have a variable x that varies from 5.62 to 31.62 and then a formula to calculate p as a function of x. When I try to plot x versus p, I get no errors but an empty plot
I would appreciate if someone can point me in the right direction. Below is the code:
clear;
x = linspace(5.62,31.62);
p = -10*log10((1+ (31.5844 * (x.^2)) + (11.24*x*cos(pi)))/ (32.5844*(1 + (x.^2))));
figure
plot(pl,x)
Thanks

採用された回答

Shubham Gupta
Shubham Gupta 2019 年 11 月 11 日
Try:
clear;
x = linspace(5.62,31.62);
p = -10*log10((1+ (31.5844 * (x.^2)) + (11.24*x*cos(pi)))./ (32.5844*(1 + (x.^2)))); % "./" instead of "/"
figure
plot(p,x) % p instead of pl
  1 件のコメント
sid101
sid101 2019 年 11 月 11 日
Thank you. This works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by