%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)

 採用された回答

Wayne King
Wayne King 2013 年 12 月 1 日
編集済み: Wayne King 2013 年 12 月 1 日

0 投票

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 件のコメント

MH LEE
MH LEE 2013 年 12 月 1 日
Wah good lah! Thanks a lot! If my computing teacher is as great as you ah.
Ok ok another question is means for all "syms" - symbolic things. If want to plot need to use ez?? what would the ez means?
Wayne King
Wayne King 2013 年 12 月 1 日
ez is just short for "easy". Please accept my answer if I have answered your question.
MH LEE
MH LEE 2013 年 12 月 1 日
Okay can can. Accepted your answers :D. than how come if dun put ez cannot plot the graph? Can i say as long anything i use symbolically, must put ez in front?
Johnathon
Johnathon 2025 年 3 月 4 日
What do you do if matlab crashes when you try and plot a graph.

サインインしてコメントする。

その他の回答 (0 件)

タグ

質問済み:

2013 年 12 月 1 日

編集済み:

2025 年 3 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by