Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Kobi
Kobi le 25 Avr 2013
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

Réponse acceptée

Craig Cowled
Craig Cowled le 25 Avr 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?

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by