⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lqgcost.m

📁 本书是电子通信类的本科、研究生辅助教材
💻 M
字号:
function f = lqgcost(x)
%LQGCOST Function which returns the difference between the
%	input and the actual output.
%	Returns a measure of the tracking performance of the system.

%	Copyright (c) 1990-94 by The MathWorks, Inc.

K = x(1:5); % The state feedback control matrix
FF = x(6);  % The feedforward gain

set_param('lqgopt/Matrix gain','D',mat2str(K))
set_param('lqgopt/FF Gain','Gain',mat2str(FF))

[t,x,y] = rk45('lqgopt',6);  % Simulate for 6 seconds
y2 = table1([t,y],0:(6/200):6);  % Interpolate over 201 points
f = y2(:,2) - y2(:,1);   % Output minus the input signal 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -