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:
Post a Comment