📄 arx2.m
字号:
function [A B] = arx2(y, u, na, nb, nk, error, pop, mutation, no_of_generations)
%% This function estimates the ARX model parameters
% [A B o] = arx2(y, u, na, nb, nk)
% y is the output, u is the input
% na nb nk ==> orders
% A, B ==> ARX model parameters
global Na Nb Nk Y U
Na = na; Nb = nb; Nk = nk; Y = y; U = u;
% consistency check
if size(Y, 1) < Na || size(U, 1) < Nb
sprintf('Needs more input or output data')
A = []; B = []; return
end
if size(U, 1) ~= size(Y, 1)
sprintf('number of input and output data must be the same')
A = []; B = []; return
end
% calling GA function
[A B] = genalg(error, pop, mutation, no_of_generations);
% o = zeros(size(Y,1),1);
% for t = max(Na+1,Nb+Nk) : size(Y)
% o(t) = -a*o(t-Na:t-1) + b*U(t-Nk-Nb+1:t-Nk); % ARX model
% end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -