This preview shows pages 1–2. Sign up to view the full content.
Assistance with Homework 1 and matlab
Question 1 types
With matlab, you can check the syntax and methodology of commands like impulse to easy ways;
type ”help impulse” in the command window or hit the yellow question mark or the Help menu
to open up the Help Window, then search for impulse. This latter approach gives examples and
explanations.
Here’s how I would check whether my solution for the inverse Laplace transform of
1
s
+1
, which is
e

t
1(
t
)
coincides with matlab’s version.
>> sys = tf(1,[1 1]);
>> [y,t]=impulse(sys);
>> plot(t,y,’r
*
’,t,exp(t),’ko’);xlabel(’Time (sec)’);ylabel(’Response’);shg
>> legend(’matlab’,’me’)
The ﬁrst line sets up the transfer function (system)
sys
=
1
s
+1
.
The second line computes the impulse response of
sys
and stores the response values in vector
y
with their corresponding time values in vector
t
. Remember this is a continuoustime problem and
the solution of the underlying differential equation need not be a uniformly spaced times.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 02/02/2010 for the course MAE MAE 143b taught by Professor Callafon during the Fall '09 term at UCSD.
 Fall '09
 CALLAFON

Click to edit the document details