📜  matlab ss2tf symbolic - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:54.493000             🧑  作者: Mango

代码示例1
function syms_frac = ss2tf_fraction_from_NUM_DEN(NUM,DEN, s)
%ss2tf_fraction_from_NUM_DEN Creates a fraction from the NUM and DEN
%vectors and the symbolic variable s
syms numerator(s)
syms denominator(s)
syms func(s)
numerator(s) = 0;
denominator(s) = 0;
num_power = length(NUM);
den_power = length(DEN);
for i = 1:num_power
    numerator(s) = numerator(s)+NUM(i)*s^(num_power-i);
end
for i = 1:den_power
    denominator(s) = denominator(s)+DEN(i)*s^(den_power-i);
end

syms_frac = numerator/denominator;
end