60.7k views
1 vote
Write a MATLAB script to generate and plot:

(a) a real sinusoidal sequence ( x[n] ) with a frequency of ( 0.5 Hz) and a phase delay of ( 90˚). The values of this sequence have to be oscillated between ±2 V.The length of the signal is 200 samples (starts from 0 in steps of 0.02 ).

User Barbolo
by
7.9k points

1 Answer

6 votes

Final answer:

To generate and plot a real sinusoidal sequence in MATLAB, you can use a script that defines the amplitude, frequency, phase delay, and time vector. This script will create a sinusoidal sequence and plot it with labels and a title.

Step-by-step explanation:

To generate and plot a real sinusoidal sequence in MATLAB with a frequency of 0.5 Hz and a phase delay of 90˚, you can use the following script:

t = 0:0.02:3.98;
freq = 0.5;
phase_delay = 90;
amplitude = 2;

x = amplitude * sin(2 * pi * freq * t + (phase_delay * pi / 180));
plot(t, x);
xlabel('Time (s)');
ylabel('Amplitude (V)');
title('Real Sinusoidal Sequence');
ylim([-2 2]);

This script creates a time vector 't' from 0 to 3.98 with a step size of 0.02. It then calculates the sinusoidal sequence 'x' using the amplitude, frequency, phase delay, and time vector. Finally, it plots 'x' against 't' and adds labels and a title to the plot.

User Rodrigo Bastos
by
8.3k points