Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
I have program of following format. I need the plot to be of different colors based on the if statement in program. How do I do it?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
iter=1500;
for I=2:iter
function stage1
body //solves 2nd order ODE and gives displacement and velocity//
end function
function stage2
body //solves 2nd order ODE and gives displacement and velocity//
end function
if displacement >0 and velocity<0
execute stage1
else if (condition)
execute stage2
//The condition goes on//
endif
endfor
plot(tim(:),displ(:,1));
Now I want the time vs displ plot to be green for stage1 values and other colors for subsequent stage values.
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!