[SOLVED] How to write and plot u(t) functions in MATLAB

Status
Not open for further replies.

Ichisuke

Newbie level 4
Joined
Dec 7, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,308
I have a small project and don't know how to write and plot the following functions in MATLAB:

f1(t) = tu(t) - tu(t-1)

f2(t) = 10{e}^{-4t }

Could someone lend me a hand here or send me a tutorial? Thanks.
 

Try the lecture notes here;
**broken link removed**
 
For the second function, f2(t) = 10{e}^{-4t }.
Use the following code:
First of all, you need to define the limits of the variable 't'. Like t goes from 0 to 1 or whatever your choice is.
I took the limits for t from 0.1 to 2, with increments of 0.1

t=0.1:0.1:2;

f=10*exp(-4*t);
plot(t,f);
 
Thanks for your help! Very useful both replies.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…