필터 지우기
필터 지우기

1st graph plots fine, 2nd graph is an error.

조회 수: 1 (최근 30일)
Matt Reiser
Matt Reiser 2015년 2월 4일
답변: Star Strider 2015년 2월 4일
x = linspace(-30,30,30001); y = ((sin(x)) ./ (x)); plot(x,y,'-'); axis([-30 30 -.25 1]) xlabel('x') ylabel('y') title('Reiser Graph of sin(x) / x') x = linspace(-20,20,20001); y = (2 ./ (sqrt(3+x.^2))); z = (-1 ./ (sqrt(2+x.^2))); >> plot(x,y,z,'-') Error using plot String argument is an unknown option.
I need both y and z plotted in 2D. Please Help

답변 (2개)

Roger Stafford
Roger Stafford 2015년 2월 4일
You cannot plot three variables in two dimensions! Either use plot3 or else plot only two of your variables. For example, plot y against x using one color and plot z against x using another color.

Star Strider
Star Strider 2015년 2월 4일
See my Comment to my Answer to your previous Question: http://www.mathworks.com/matlabcentral/answers/175177-i-have-a-problem.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by