Plotting multiple polynomials in matlab

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
TaylorWatts
Messages
15
Reaction score
0
Ok, I can plot a single polynomial easy enough such as 3*(x^2)-1 using fplot, but I want to graph multiple polynomials.

When I try to use the plot it doesn't work even for one though. The graph is completely wrong.

ie I make a new m-file.

x = [-1:1];

y = 3*x.^2 - 1;

Then call the m-file in the command window.

Then plot(x,y,'-b')

But I get something resembling the absolute value of x instead :confused:
 
Physics news on Phys.org
There is only three points in your x vector! try a smaller step size.