I want to plot with different colors for each value of vm1

1 次查看(过去 30 天)
Hi all,
I want to plot the each value of vm1 with different colors manually.
I attached only the short code which is given below,
for . .
vm1=[0.4;0.3975;0.395;0.39;0.385;0.38;-0.32;-0.33;-0.34;-0.35;-0.36;-0.37;-0.4];
for i=1:13
vm=vm1(i);
im=mem_appr(y(:,1),vm,param).*vm;
p=vm.*im;
der_state=(A*sinh(vm/sigma_off).*exp(-(y_off./y(:,1)).^2).*exp(1./(1+beta*p)).*(exp(-k*vm)./(1+exp(-k*vm)));
plot(y(:,1),der_state, 'linewidth',2)
hold all
end
end
Could anyone please help me.

回答(1 个)

KSSV
KSSV 2017-7-20
plot(x,y,'color','r') ;
The above command plot's (x,y) data in red color.
If you want to put your colors of choice, check the below codes:
c = {'r' 'b' 'g'} ;
figure
hold on
for i = 1:3
plot(rand(1,10),'color',c{i})
end
figure
hold on
for i = 1:3
plot(rand(1,10),'color',rand(1,3))
end

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by