Azzera filtri
Azzera filtri

how to acces and change value inside transfer function inside a loop

3 visualizzazioni (ultimi 30 giorni)
i'm trying to change the k value from 0.1 to 7 that is inside transfer function but i have a problem i just don't know how to find the index inside this cells please help.
this is my code:
clear all
clc
kvals=0.1:0.1:7; % Change the values of k parameter
for kidx=1:length(kvals);
k=kvals(kidx);
G(kidx)=tf([k],[10*10^-3 1]);
GG=tf([G.num{1,1}],[G.den{1,1}(k)]);
Gtotal(kidx)=feedback(GG,1);
%TAU(kidx)=(G(k).den{1}(1))/(G(k).num{1}(2));
end

Risposta accettata

Craig Cowled
Craig Cowled il 25 Apr 2013
Kobi, I tried running your code and got an error message. It looks like you missed a space between G.den{1,1} and (k) in the line GG=tf([G.num{1,1}],[G.den{1,1} (k)]);
Is this the problem?

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements 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!

Translated by