using syms x to create an equation Y(x), then letting x be a vector to plot, x vs Y
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nicholas
am 27 Okt. 2013
Kommentiert: Walter Roberson
am 28 Okt. 2013
using syms x I have created an equation
Y = (x/20 - 2)*(x/40 - 1) - (x/20 - 1)^2 + x^2/800
I would now like to set x = to a vector say [0:0.1:40] and would like plot(x,Y)
how can i implement this because when i try plot(x,Y) i get an error of
EDU>> plot(x,Y) ??? Error using ==> plot Conversion to double from sym is not possible.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Okt. 2013
Bearbeitet: Walter Roberson
am 27 Okt. 2013
xvals = 0:0.1:40;
plot(xvals, double(subs(Y, x, xvals)))
3 Kommentare
Walter Roberson
am 28 Okt. 2013
That equation does evaluate to 1. Expand the first multiplication, expand the squared term, add the two together, then note that the x^2 term cancels with the remaining term in Y, leaving just 1.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!