Borrar filtros
Borrar filtros

How to replace variable 's' in the transfer function with another variable

10 visualizaciones (últimos 30 días)
Consider a=1 and b=[1 2]; d=tf(a,b); how do we replace the 's' term in d with (g+1) or (g+1)/(g-2)? Is that even possible?
  2 comentarios
Adam
Adam el 3 de Dic. de 2014
What 's' term? You have d, tf, g, a and b in your question.
Joshua
Joshua el 8 de En. de 2015
The transfer function is d=s/((s+1)(s+2)). Can i replace the 's' with any other variable like 'g+1' or '(g+1)/(g+2)'?

Iniciar sesión para comentar.

Respuestas (1)

Andrei Bobrov
Andrei Bobrov el 3 de Dic. de 2014
yourTransferfunction = @(g)d(g+1);
  3 comentarios
swarmer
swarmer el 22 de Oct. de 2020
This is known as an Anonymous Function. It is similar to lambdas from other programming like Python. Here is Wiki link if anyone wants to read into it further: https://en.wikipedia.org/wiki/Anonymous_function
Fabio Gavilan
Fabio Gavilan el 28 de Abr. de 2022
If you fill in yourTransferfunction(1) you get:
"Error using indexing Subscript no. 2 is out of range."
This does not change the variable in the expected way.

Iniciar sesión para comentar.

Categorías

Más información sobre Software Development Tools en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by