필터 지우기
필터 지우기

Why won't Matlab plot anything?

조회 수: 216 (최근 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 CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by