# Why is my fplot not working?

조회 수: 5 (최근 30일)
Kyle Donk 2020년 2월 1일
댓글: Star Strider 2020년 2월 1일
My fplot is not working in my code. A few minutes ago, the code was plotting the graph just fine, but now it isn't. I can't figure out what is wrong. Matlab keeps saying that "Second argument must be a scalar or vector of unique symbolic variables."
%Symbolically find the roots of the following equation using 'solve'
syms x y(x)
y(x)=x^3+1
solve(x^3+1)
%Find what y equals when x=0
subs(y,x,0)
%Graph the equation on the interval [-10,10]
fplot(y,[-10,10],'b')
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Kyle Donk 2020년 2월 1일
Huh, it's working now. I guess I didn't exit my graph from the previous iterations of running my code, so it just kept the old graph instead of generating a new one.
Star Strider 2020년 2월 1일
That’s the reason I always use figure to create a new one for each plot. Otherwise, MATLAB uses the existing axes.

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

### 카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by