Plot graph of different color for different points? Matlab

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 22K views
cks
Messages
164
Reaction score
0
I would like to plot a curve with each point with different color.

For example

x0=2;
for i=1:1:200
x1=x0*cos(x0)+exp(x0);
plot(i,x1) (THIS IS THE PLACE WHERE I WANT TO PUT DIFFERENT COLOR)
x0=x1;
end
 
Physics news on Phys.org
scatter(1:10,2:11,50,jet(10))