I am trying to plot the following:
x=linspace(0,10);
y1=x./(1+x); y2=x.^2./(1+x.^2);
plot(x,y1,"g--",x,y2,"b")
I got this code from the answer of a task in a course book so it must be accurate but it still wont plot, all I get is Error using plot Invalid first data argument
what can I do to make it plot?

 채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 9일

0 개 추천

Depending on your MATLAB version, you might need to use ' for strings instead of "
But also check:
which plot
It should say something similar to
built-in (/Applications/MATLAB_R2017b.app/toolbox/matlab/graph2d/plot)
but it would not surprise me if instead you are getting a plot() from some toolbox that the course text provided.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2018년 1월 9일

답변:

2018년 1월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by