Same colour for two curves in a plot
Afficher commentaires plus anciens
Hi MATLAB Community,
I need to have the first and third cuve the same colour, how do i do that?
I would really ppriciate some help on how to do that.
a = [ 100, 65, 95];
b = [-100, 65, 90];
c = [50, 20, 20];
d = [-25, 20, 20];
x = linspace(-200, 100, 200)
for k = 1:numel(a)
y(k,:) = a(k)+b(k)*tanh((x+c(k))/d(k));
end
figure;
plot(x, y);
Réponse acceptée
Plus de réponses (1)
Sajid Afaque
le 7 Avr 2021
you can also use color instead of triplets
h=plot(x,y);
set(h, {'color'}, {'r'; 'b'; 'r'});
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!