x=0:pi/100:2*pi; y=sin(x); if x>3 plot(x,y,"b*") else x<=3; plot(x,y,"g*") end I Want PLot X>3 using Defferent Color
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Amir Azadeh Ranjbar
le 3 Déc 2021
Commenté : Amir Azadeh Ranjbar
le 3 Déc 2021
clc;clear;close all
x=0:pi/100:2*pi;
y=sin(x);
if x>3
plot(x,y,"b*")
else x<=3;
plot(x,y,"g*")
end
Réponse acceptée
Walter Roberson
le 3 Déc 2021
x=0:pi/100:2*pi;
y=sin(x);
mask = x > 3;
plot(x(mask), y(mask), "b*")
hold on
plot(x(~mask), y(~mask), "g*")
hold off
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Messages dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
