How can I fix this error?

Illustration
kmuhfht - 2020-02-12T14:15:39+00:00
Question: How can I fix this error?

How can I fix this error?   sys=tf([1 1 1 1],[1 1]); t=0:0.1:10; step(sys,t) ??? Error using ==> DynamicSystem.step at 84 Cannot simulate the time response of models with more zeros than poles. I know that my system is unstable but how can I receive an "unstable" graph for this system on my axes?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

Just FYI the following code won't provide the same graph has the step function, it just plots the function having s as the variable, the step fuction just works for proper systems (n poles >= n zeros).

"Impulse response":

syms s
TFC=evalc('tf([1 1 1 1],[1 1])');
[a b] = strread(TFC, '%s %s', 'delimiter',char(10));
num=sym(char(a(2)));
den=sym(char(a(3)));
ezplot(num/den,[0 100])

"Step response"

syms s 
TFC=evalc('tf([1 1 1 1],[1 1 0])');
[a b] = strread(TFC, '%s %s', 'delimiter',char(10)); 
num=sym(char(a(2))); 
den=sym(char(a(3))); 
ezplot(num/den,[0 100])
The scales aren't the same like you get with the step function.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!