- #1
sara_87
- 763
- 0
Homework Statement
Hi all,
I am trying to plot multiple curves in matlab.
If i have the function:
y=x^i
where i goes from 1 to 10.
I want to plot the function y for each i.
Homework Equations
The Attempt at a Solution
x=[1 2 3 4 5 6 7 8 9 10]
for i =1:10
y = x.^i
end
plot(x,y)
this returns 10 sets of the answer y. I want to plot these 10 curves on the same graph.
the above code only plots x against y for the last case (when i=10)
any help would be very much appreciated.
thank you