126k views
2 votes
Write a MATLAB script to generate and plot:

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 ).

1 Answer

2 votes

Final answer:

To generate and plot a real sinusoidal sequence in MATLAB with a frequency of 0.5 Hz and a phase delay of 90°, use the sine function. Set the values to oscillate between ±2 V and the length of the signal to be 200 samples, starting from 0 in steps of 0.02.

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°, we can use the sine function. The values of the sequence need to oscillate between ±2 V. The length of the signal should be 200 samples, starting from 0 and incrementing by 0.02.

In MATLAB, you can use the following script:

t = 0:0.02:3.98;

x = 2*sin(2*pi*0.5*t + pi/2);

plot(t, x);

xlim([0, 4]);

ylim([-2, 2] ;

xlabel('Time (s)');

ylabel('Amplitude (V)');

User BetterCallMe
by
6.8k points