11.30.2006

lost in translation

This was an email from a professor to students. It's supposed to clarify the homework. I should say something in the way of clarification myself. Matlab is a computer program. Anyway... See if you can follow his english.

Dear All,

For Programming #2, by "pencil-and-paper" we mean using Matlab.

In Matlab, when you have got a string of expression, how to put an array input and get the array output?
Here is the trick by following example

syms x
impulse_response=cos(x);
t=0:0.01:pi;
hh=subs(impulse_response,x,t);
plot(t,hh)

Note: x and impulse_response are all symbolic strings; t is the numerical array,
"hh" is also an numerical array.

So, the magic is the "subs". To know more on "subs", type "help subs"

HTH. YangQuan Chen


Classic.

No comments: