identification.cpp

来自「广义预测算法MATLAB转化为VC++的程序,可用于三容水箱的数据的采集.」· C++ 代码 · 共 57 行

CPP
57
字号
  #include "matlib.h"
  #pragma hdrstop
  
  #include "identification.h"
  
  
  Mm identification(Mm theta, Mm P, Mm y, Mm x, Mm rou, Mm dy, i_o_t, Mm& theta__o, Mm& P__o) {
    begin_scope
    theta.setname("theta"); P.setname("P"); y.setname("y"); x.setname("x"); rou.setname("rou"); dy.setname("dy");  \
      
    dMm(e); 
    
    #line 1 "c:/matcom45/identification.m"
    call_stack_begin;
    #line 1 "c:/matcom45/identification.m"
    // nargin, nargout entry code
    double old_nargin=nargin_val; if (!nargin_set) nargin_val=6.0;
    nargin_set=0;
    double old_nargout=nargout_val; if (!nargout_set) nargout_val=2.0;
    nargout_set=0;
    
    // translated code
    
    #line 2 "c:/matcom45/identification.m"
_   e = dy-ctranspose(x)*theta;
    #line 3 "c:/matcom45/identification.m"
_   theta = theta+P*x*e/(rou+ctranspose(x)*P*x);
    #line 4 "c:/matcom45/identification.m"
_   P = (P-(P*x*ctranspose(x)*P)/(rou+ctranspose(x)*P*x))/rou;
    
    call_stack_end;
    
    // nargin, nargout exit code
    nargin_val=old_nargin; nargout_val=old_nargout;
    
    // function exit code
    theta.setname(NULL); P.setname(NULL); y.setname(NULL); x.setname(NULL); rou.setname(NULL); dy.setname(NULL);  \
      
    theta__o=theta; P__o=P; 
    return x_M;
    end_scope
  }
  
  
  Mm identification(Mm theta, Mm P, Mm y, Mm x, Mm rou, Mm dy) {
    begin_scope
    double old_nargin=nargin_val; nargin_val=6.0; nargin_set=1;
    double old_nargout=nargout_val; nargout_val=1.0; nargout_set=1;
    dMm(theta__o); dMm(P__o); 
    identification(theta, P, y, x, rou, dy, i_o, theta__o, P__o);
    nargout_val=old_nargout;
    nargin_val=old_nargin;
    return(theta__o);
    end_scope
  }
  

⌨️ 快捷键说明

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