フィルターのクリア

Why won't Matlab plot anything?

215 ビュー (過去 30 日間)
Josh
Josh 2012 年 3 月 29 日
コメント済み: DGM 2023 年 6 月 17 日
When I try to plot anything, nothing comes up. There are no errors, there's just nothing.
>> x=-10:.1:10;
>> y=sin(x);
>> plot(x,y);
No figure window pops up.
  2 件のコメント
777
777 2012 年 3 月 29 日
are there no error reports???
Thomas
Thomas 2012 年 3 月 29 日
Should work.. Does
figure()
open up the figure window?

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

採用された回答

M
M 2012 年 3 月 29 日
You may have previous plot open somewhere and Matlab is plotting it on the same figure. Check for open figures, you might find it.
Alternatively, Use "close all" at the beginning and try again.
close all
x=-10:.1:10;
y=sin(x);
plot(x,y);
  10 件のコメント
Yash dev
Yash dev 2023 年 6 月 15 日
my plot function showing that
plot script as a function is not supported what to do??
DGM
DGM 2023 年 6 月 17 日
Rename your script so that it doesn't conflict with the names of existing functions.

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

その他の回答 (3 件)

Josh
Josh 2012 年 3 月 29 日
I typed in figure() and now it works perfectly. Thanks for the help.
  1 件のコメント
Jing Yin
Jing Yin 2020 年 3 月 28 日
Thank you. It solves my problem too.

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


Mitchell Frisch
Mitchell Frisch 2019 年 4 月 19 日
Try adding a line style to your plot function, such as
plot(x, y 'b-')
I've had a similar problem and this fixed it for me
  2 件のコメント
atousa yazdani
atousa yazdani 2022 年 4 月 27 日
hasn't helped me!
Walter Roberson
Walter Roberson 2022 年 4 月 27 日
You do not appear to have posted your code, which makes it difficult for us to tell you how to repair it. It is not at all productive for us to list all of the different ways that can possibly lead to a plot not working as expected.

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


Megat
Megat 2023 年 5 月 23 日
q=5; s=0.002; b=20; n=0.03;
g=@(f) ((s*sqrt)*(b*h)^(5/3))/(n*(b+2*h)^(2/3))-q;
fplot(g,[0 1]), grid, xlabel('f'), ylabel('g(f)')
why it show nothing
  1 件のコメント
DGM
DGM 2023 年 5 月 24 日
You should get an error message that tells you why.
You created g as a function of f, but not only is it invariant on f, it's a function of h, which is undefined.

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

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by