create a graph of an input signal of 2 volts peak-to-peak at 1 kilohertz in red color and an output signal of 2 volts peak-to-peak at 1 kilohertz with a phase angle of 180 degrees in blue color in matlab
main.m
% Generate time vectorfs = 10000; % Sampling frequency in Hzt = 0:1/fs:1-1/fs; % Time vector from 0 to 1 second% Input signalf_input = 1000; % 1 kHz frequencyinput_signal = 1 * sin(2*pi*f_input*t); % Amplitude of 1 and no phase shift% Output signalf_output = f_input; % Same frequency as inputoutput_signal = 1 * sin(2*pi*f_output*t + pi); % Amplitude of 1 and 180 degrees phase shift% Plot signalsfigure;
plot(t, input_signal, 'r', t, output_signal, 'b');
xlabel('Time (s)');
ylabel('Amplitude');
title('Input and Output Signals');
legend('Input Signal (1 kHz)', 'Output Signal (1 kHz with 180 degree phase shift)', 'Location', 'northwest');