Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Craig Cowled
Craig Cowled el 25 de Abr. de 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?

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements 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