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

1 view (last 30 days)
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

Accepted Answer

Craig Cowled
Craig Cowled on 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?

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!