Problem with plot function

조회 수: 1 (최근 30일)
Hanna Sundling
Hanna Sundling 2019년 10월 10일
댓글: Image Analyst 2019년 10월 10일
I can not run this function, it says that something is wrong with my function. Help? It says that for every function of all my scripts.
I also have x = linspace(-5,5,100) in the script.

채택된 답변

adeq123
adeq123 2019년 10월 10일
Hi,
Works for me. Probably you clear your workspace before running this part of the code. Therefore the x is not found.
x = linspace(-5,5,100);
y = (x-1)./(x.^2+x);
plot(x,y);
  댓글 수: 3
adeq123
adeq123 2019년 10월 10일
There is no error - like I said, works for me.
My assumtion is that the author of the topic cleared the workspace before running the code and this is why she gets the error.
Image Analyst
Image Analyst 2019년 10월 10일
haisong:
For some reason, you forgot to show lines 1 and 2 (where you claim the crucial linspace was called) in the image you posted! Please attach the image showing those lines, or attach the m-file script with the paper clip icon.

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

추가 답변 (1개)

haisong zhao
haisong zhao 2019년 10월 10일
No problem in the code

Community Treasure Hunt

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

Start Hunting!

Translated by