0% found this document useful (0 votes)
10 views

1 Plot of Equation 1, Question 10: Function

This document contains MATLAB code to plot two equations from Question 10. The first section plots the equation e-t(u(t)-u(t-2)) on the interval -2 to 2 with over 4000 sampling points. It creates an inline function for the equation, defines the time vector t, plots the graph and labels the axes. The second section repeats this process for the equation 0.5(u(t+1)), plotting it on the same interval with the same number of sampling points.

Uploaded by

wearole
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

1 Plot of Equation 1, Question 10: Function

This document contains MATLAB code to plot two equations from Question 10. The first section plots the equation e-t(u(t)-u(t-2)) on the interval -2 to 2 with over 4000 sampling points. It creates an inline function for the equation, defines the time vector t, plots the graph and labels the axes. The second section repeats this process for the equation 0.5(u(t+1)), plotting it on the same interval with the same number of sampling points.

Uploaded by

wearole
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Plot of Equation 1, Question 10 1 0.9 0.8 0.

e-t(u(t)-u(t-2))

0.6 0.5 0.4 0.3 0.2 0.1 0 -2

-1.5

-1

-0.5

0 t

0.5

1.5

function [ x ] = equation1( t ) %Problem Set #1 %Question 10: %Graph the equations on a labeled plot with %enough points to accurately describe equation. %Create the function using the unit step x= inline('exp(-t).*(t>=0&t<1)','t'); %Create the time interval, make sure that there are enough sampling points. t= (-2:0.0001:2); %Plot the graph and label the axes. plot(t,x(t)); xlabel('t'); ylabel('e^-t(u(t)-u(t-2))'); title('Plot of Equation 1, Question 10');

end

Plot of Equation 2, Question 10 0.5 0.45 0.4 0.35

0.5(u(t+1))

0.3 0.25 0.2 0.15 0.1 0.05 0 -2

-1.5

-1

-0.5

0 t

0.5

1.5

function [ x ] = equation2( t ) %%Graph the equations on a labeled plot with %enough points to accurately describe equation. %Create the function using the unit step x= inline('0.5.*(t>1)','t'); %Create the time interval, make sure that there are enough sampling points. t= (-2:0.0001:2); %Plot the graph and label the axes. plot(t,x(t)); xlabel('t'); ylabel('0.5(u(t+1))'); title('Plot of Equation 2, Question 10');

end

You might also like