Plotting Output of Function Given Transfer Function and Input in MATLAB

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
magnifik
Messages
350
Reaction score
0
i am trying to plot the output of a function given the transfer function and an input. however, i am having trouble with trying to express the input as a function in MATLAB

my transfer function is
m = 1;
b = 2;
k = 1000;
num = [ 1000 ];
den = [ m b k ];
transferfunction = tf(num, den)

so it's equal to H(s) = 1000/(s^2 + s + 1000)

i am given that the input is 1 from 0 < t < 10 and 0 elsewhere
i know that x(t) in terms if unit step is x(t) = U(t)*U(10 - t) --- how do i express this in MATLAB?

after this, my plan is to do q = ilaplace(transferfunction) and conv(q, x) to get the output. is this a correct method?
 
Physics news on Phys.org
is this correct...
t = 0:0.001:10; %do i even need this??
td = 10;
x1 = heaviside(t) - heaviside(t-td);