[go: up one dir, main page]

0% found this document useful (0 votes)
15 views2 pages

Corrected MATLAB Code Output

The document provides corrected MATLAB code for plotting three types of functions: a unit ramp function, a sinc function, and a sinusoidal function. Each function is represented in both continuous and discrete forms using subplots. The expected output includes descriptions of the visual characteristics of each function.

Uploaded by

armanidrishi1717
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Corrected MATLAB Code Output

The document provides corrected MATLAB code for plotting three types of functions: a unit ramp function, a sinc function, and a sinusoidal function. Each function is represented in both continuous and discrete forms using subplots. The expected output includes descriptions of the visual characteristics of each function.

Uploaded by

armanidrishi1717
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

You might also like