Plotting multiple polynomials in matlab

  • #1
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:
 
  • #2
There is only three points in your x vector! try a smaller step size.
 

Suggested for: Plotting multiple polynomials in matlab

Replies
4
Views
883
Replies
4
Views
491
Replies
1
Views
1K
Replies
1
Views
790
Replies
4
Views
917
Replies
1
Views
5K
Replies
2
Views
1K
Replies
6
Views
734
Replies
2
Views
966
Back
Top