Why does the MATLAB plot show up with no function on it?

조회 수: 4 (최근 30일)
Liam Reid
Liam Reid 2020년 11월 10일
댓글: Jon 2020년 11월 11일
figure()
x = linspace(0,1000);
y1 = (sqrt(2)*sqrt(x.^4 + 9)) ./ (2*x.^2);
plot(x,y1)
xlim([1,2])
ylim([0.8,2])

답변 (1개)

Jon
Jon 2020년 11월 10일
편집: Jon 2020년 11월 10일
Your plot limits are outside of the range of the data.
Also you don't have enough (or any data points) in the range of x that you are plotting.
If you truly want to plot for x between 1 and 2 try
figure()
x = linspace(1,2); % just range of interest
y1 = (sqrt(2)*sqrt(x.^4 + 9)) ./ (2*x.^2);
plot(x,y1)
xlim([1,2])
ylim([0.8,2])
  댓글 수: 3
Liam Reid
Liam Reid 2020년 11월 10일
Thanks Jon I think I just figured it out!
Jon
Jon 2020년 11월 11일
Please accept this answer if it solved your problem

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by