Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I change the line color in a graph using plot?

1 visualización (últimos 30 días)
Yasir Ghazi
Yasir Ghazi el 17 de Nov. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
to plot this figure
clc;
clear all;
close all;
fs = 1000;
t = 0:1/fs:0.2;
Vm = 720; % Volt
f0 = 50 ;% Hz
q = 0.5 ; % Voltage Gain
alpha = 0;
Va = Vm*q*cos(2*pi*f0*t + alpha);
Vb = Vm*(q + 0.2*q*(t == 0.1)).*cos(2*pi*f0*t + alpha);
figure,
plot(t,Va,'r',t,Vb,'b');
xlabel('Time');
ylabel('Va and Vb');
  1 comentario
Walter Roberson
Walter Roberson el 17 de Nov. de 2017
Your code
plot(t,Va,'r',t,Vb,'b');
already sets the color of the Va plot to be red and of the Vb plot to be blue.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by