Plotting multiple polynomials in matlab

  • MATLAB
  • Thread starter TaylorWatts
  • Start date
  • #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:
 

Answers and Replies

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

Related Threads on Plotting multiple polynomials in matlab

Replies
0
Views
5K
Replies
1
Views
6K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
1
Views
9K
  • Last Post
Replies
8
Views
5K
  • Last Post
Replies
1
Views
7K
  • Last Post
Replies
7
Views
3K
Replies
1
Views
879
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
879
Top