Why can't I plot a graph?
8 views (last 30 days)
Show older comments
%Hi guys. I am a noob here. I did Matlab and Simulink in Uni before but I am still a noob in it and hope to spent sometime to %learn Matlab. I just wanted to try plot an equation and my script is as follows:
syms x;
y = x^2 + 4*x + 4
plot (y)
%Answer:
>> pl1
y =
x^2 + 4*x + 4
Error using plot Conversion to double from sym is not possible.
Error in pl1 (line 5) plot (y)
0 Comments
Accepted Answer
Wayne King
on 1 Dec 2013
Edited: Wayne King
on 1 Dec 2013
Why do you need to plot this symbolically:
x = -2:0.01:2; % or whatever the range
y = x.^2 + 4*x + 4;
plot(x,y)
If you want to plot symbolically:
syms x;
ezplot(x^2+4*x+4,[-2 2])
4 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!