Corrected MATLAB Code and Output Explanation:
% UNIT RAMP FUNCTION %
clc;
clear all;
close all;
N = 100;
t = 0:20;
x = t;
subplot(2,1,1);
plot(t, x, 'g');
xlabel('Time');
ylabel('Amplitude');
title('Unit Ramp Function');
subplot(2,1,2);
stem(t, x, 'r');
xlabel('Time');
ylabel('Amplitude');
title('Unit Ramp Discrete Function');
% SINE FUNCTION %
clc;
clear all;
close all;
t = linspace(-5, 5, 100);
x = sinc(t);
subplot(2,1,1);
plot(t, x, 'g');
xlabel('Time');
ylabel('Amplitude');
title('Sinc Signal');
subplot(2,1,2);
stem(t, x, 'r');
xlabel('Time');
ylabel('Amplitude');
title('Sinc Sequence');
% SINUSOIDAL FUNCTION %
clc;
clear all;
close all;
t = 0:0.01:2;
x = sin(2*pi*t);
subplot(2,1,1);
plot(t, x, 'g');
xlabel('Time');
ylabel('Amplitude');
title('Sinusoidal Signal');
subplot(2,1,2);
stem(t, x, 'r');
xlabel('Time');
ylabel('Amplitude');
title('Sinusoidal Sequence');
Expected Output Explanation:
OUTPUT DESCRIPTION:
1. UNIT RAMP FUNCTION:
- A straight line increasing over time (plot and stem) from 0 to 20.
2. SINC FUNCTION:
- A sinc waveform with a central peak at 0 and oscillating decaying side lobes.
3. SINUSOIDAL FUNCTION:
- A smooth sine wave with 1Hz frequency shown as continuous and discrete plots.