how can i plot graphs with various colors
Mostrar comentarios más antiguos

for jj = 1:12
col=hsv(12);
[T,Y]=ode45(@solve_for_state_error_nonlinear,[0,sim_time],init_cond,options1);
figure
plot(time,Angle_mag(:,1),'color',col(jj,:));
title('Angle with the magnetic field (deg)');
xlabel('time(s)')
end
This is the code i am using and i am getting the plots as shown in the figure.I need a graph with different colors in the same graph but i am getting different graphs with different colors.
Thanks in advance
Respuestas (1)
Azzi Abdelmalek
el 4 de Oct. de 2013
Editada: Azzi Abdelmalek
el 4 de Oct. de 2013
[T,Y]=ode45(@solve_for_state_error_nonlinear,[0,sim_time],init_cond,options1
col=hsv(numel(T));
for jj = 1:numel(T)
plot(T,Y(jj,1),'.','color',col(jj,:));
hold on
end
title('Angle with the magnetic field (deg)');
xlabel('time(s)')
1 comentario
sruteesh kumar
el 4 de Oct. de 2013
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!