I m trying to write m. file that would do the following if I enter this in the command window:
>> test
Enter the function: (s^2+6*s+9)/(s^3+2*s^2-s-2)
The Poles:
-2
-1
1
The Zeros:
-3
-3
The Result:
1/(3*exp(2*t)) - 2/exp(t) + (8*exp(t))/3
The Initial Value:
1
我在此试图:(当然,它不工作)
function y = f(s)
y = input( Enter the function: );
[n d] = numden(y);
zeros = solve(n);
poles = solve(d);
yt = ilaplace(y);
disp( The Poles: );
disp(poles);
disp( The Zeros: );
disp(zeros);
disp( The Result: );
disp(yt);
disp( The Initial Value: );
disp(f(0));