How to replace variable 's' in the transfer function with another variable
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Andrei Bobrov
il 3 Dic 2014
yourTransferfunction = @(g)d(g+1);
3 Commenti
swarmer
il 22 Ott 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
il 28 Apr 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.
Vedere anche
Categorie
Scopri di più su Software Development Tools in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!