Plotting multiple polynomials in matlab

  • MATLAB
  • Thread starter TaylorWatts
  • Start date
  • #1

Main Question or Discussion Point

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:
 

Answers and Replies

  • #2
418
3
There is only three points in your x vector! try a smaller step size.
 

Related Threads on Plotting multiple polynomials in matlab

Replies
1
Views
6K
Replies
0
Views
5K
  • Last Post
Replies
8
Views
5K
  • Last Post
Replies
1
Views
8K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
6
Views
1K
Replies
2
Views
6K
  • Last Post
Replies
6
Views
105K
Top