주요 콘텐츠

이 페이지는 기계 번역을 사용하여 번역되었습니다. 영어 원문을 보려면 여기를 클릭하십시오.

항공기 위치 레이다 모델

이 모델은 MATLAB® 스크립트를 포함하는 Simulink® 모델에 대해 생성된 코드를 보여줍니다.

이 모델에는 레이다 측정값을 바탕으로 항공기의 위치를 추정하는 확장 칼만 필터가 포함되어 있습니다. MATLAB 스크립트인 AircraftPositionData.m에는 모델 실행에 필요한 데이터가 포함되어 있습니다. 예상 위치와 실제 위치는 작업 공간에 저장되며, 시뮬레이션이 끝날 때 AircraftPositionPlot.m 프로그램(시뮬레이션에서 자동으로 호출됨)에 의해 그래프로 표시됩니다.

모델 검토 및 시뮬레이션

모델을 검토하고 시뮬레이션을 실행하십시오.

Simulink 모델을 엽니다.

model='AircraftPositionRadar';
open_system(model)
AircraftPositionRadar([],[],[],'compile');
AircraftPositionRadar([],[],[],'term');

MATLAB 편집기에서 MATLAB 함수 블록 RadarTrackerFcn을 엽니다.

open_system([model,'/RadarTrackerFcn'])

모델을 시뮬레이션하고 결과를 검토하십시오.

sim(model)

모델에 대한 코드 생성

Simulink Coder에서 제공하는 서브시스템 빌드 기능을 사용하여 모델의 칼만 필터 부분에 대한 코드를 생성합니다. 첫 번째 빌드에서는 모델이 Simulink Coder™를 사용하여 코드 생성을 수행하도록 구성되어 있습니다. 두 번째 빌드에서는 모델이 Embedded Coder®를 사용하여 코드를 생성하도록 구성되어 있습니다.

Simulink Coder를 사용하여 모델을 구성하고 빌드합니다.

set_param(model, "SystemTargetFile", "grt.tlc");
slbuild([model,'/RadarTrackerFcn'])
### Searching for referenced models in model 'RadarTrackerFcn'.
### Total of 1 models to build.
### Starting build procedure for: RadarTrackerFcn
### Successful completion of build procedure for: RadarTrackerFcn

Build Summary

Top model targets:

Model            Build Reason                                         Status                        Build Duration
==================================================================================================================
RadarTrackerFcn  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 16.481s

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.03s

Embedded Coder를 사용하여 모델을 구성하고 빌드합니다.

set_param(model, "SystemTargetFile", "ert.tlc");
slbuild([model,'/RadarTrackerFcn'])
### Searching for referenced models in model 'RadarTrackerFcn'.
### Total of 1 models to build.
### Starting build procedure for: RadarTrackerFcn
### Successful completion of build procedure for: RadarTrackerFcn

Build Summary

Top model targets:

Model            Build Reason                                         Status                        Build Duration
==================================================================================================================
RadarTrackerFcn  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 14.183s

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 14.905s

RadarTrackerFcn.c의 일부를 아래에 소개합니다.

cfile = fullfile(pwd,'RadarTrackerFcn_ert_rtw','RadarTrackerFcn.c');
coder.example.extractLines(cfile,'/* Model step', '/* Model initialize', 1, 0);
/* Model step function */
void RadarTrackerFcn_step(void)
{
  __m128d tmp_0;
  __m128d tmp_2;
  __m128d tmp_3;
  real_T P_tmp[16];
  real_T Phi_0[16];
  real_T Q[16];
  real_T Q_0[16];
  real_T M[8];
  real_T W[8];
  real_T tmp[8];
  real_T x_tmp[8];
  real_T b[4];
  real_T x[4];
  real_T tmp_1[2];
  real_T Bearinghat;
  real_T Phi_1;
  real_T Phi_2;
  real_T Rangehat;
  int32_T Q_tmp;
  int32_T i;
  int32_T j;
  int32_T tmp_4;
  int32_T tmp_5;
  int32_T x_tmp_tmp;
  int8_T Phi[16];
  static const real_T e[4] = { 0.0, 0.005, 0.0, 0.005 };

  static const real_T c_b[4] = { 90000.0, 0.0, 0.0, 1.0E-6 };

  /* MATLAB Function: '<Root>/RadarTrackerFcn' incorporates:
   *  Inport: '<Root>/meas'
   */
  Phi[0] = 1;
  Phi[4] = 1;
  Phi[8] = 0;
  Phi[12] = 0;
  Phi[2] = 0;
  Phi[6] = 0;
  Phi[10] = 1;
  Phi[14] = 1;
  Phi[1] = 0;
  Phi[3] = 0;
  Phi[5] = 1;
  Phi[7] = 0;
  Phi[9] = 0;
  Phi[11] = 0;
  Phi[13] = 0;
  Phi[15] = 1;
  memset(&Q[0], 0, sizeof(real_T) << 4U);
  for (j = 0; j < 4; j++) {
    Q_tmp = j << 2;
    Q[j + Q_tmp] = e[j];
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (i = 0; i < 4; i++) {
      x_tmp_tmp = i << 2;
      tmp_3 = _mm_set1_pd(RadarTrackerFcn_DW.P[Q_tmp + i]);
      _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_mul_pd(_mm_set_pd(Phi[x_tmp_tmp +
        1], Phi[x_tmp_tmp]), tmp_3), _mm_set_pd(Bearinghat, Rangehat)));
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_mul_pd(_mm_set_pd(Phi[x_tmp_tmp +
        3], Phi[x_tmp_tmp + 2]), tmp_3), _mm_set_pd(Phi_2, Phi_1)));
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
    }

    Phi_0[Q_tmp + 3] = Phi_2;
    Phi_0[Q_tmp + 2] = Phi_1;
    Phi_0[Q_tmp + 1] = Bearinghat;
    Phi_0[Q_tmp] = Rangehat;
  }

  for (i = 0; i < 4; i++) {
    Rangehat = Phi_0[i + 4];
    Bearinghat = Phi_0[i];
    Phi_1 = Phi_0[i + 8];
    Phi_2 = Phi_0[i + 12];
    for (x_tmp_tmp = 0; x_tmp_tmp <= 2; x_tmp_tmp += 2) {
      j = (x_tmp_tmp << 2) + i;
      Q_tmp = ((x_tmp_tmp + 1) << 2) + i;
      _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_add_pd(_mm_add_pd(_mm_add_pd
        (_mm_mul_pd(_mm_set1_pd(Rangehat), _mm_set_pd(Phi[x_tmp_tmp + 5],
        Phi[x_tmp_tmp + 4])), _mm_mul_pd(_mm_set1_pd(Bearinghat), _mm_set_pd
        (Phi[x_tmp_tmp + 1], Phi[x_tmp_tmp]))), _mm_mul_pd(_mm_set1_pd(Phi_1),
        _mm_set_pd(Phi[x_tmp_tmp + 9], Phi[x_tmp_tmp + 8]))), _mm_mul_pd
        (_mm_set1_pd(Phi_2), _mm_set_pd(Phi[x_tmp_tmp + 13], Phi[x_tmp_tmp + 12]))),
        _mm_set_pd(Q[Q_tmp], Q[j])));
      RadarTrackerFcn_DW.P[j] = tmp_1[0];
      RadarTrackerFcn_DW.P[Q_tmp] = tmp_1[1];
    }
  }

  Rangehat = 0.0;
  Bearinghat = 0.0;
  Phi_1 = 0.0;
  Phi_2 = 0.0;
  for (i = 0; i < 4; i++) {
    x_tmp_tmp = i << 2;
    tmp_3 = _mm_set1_pd(RadarTrackerFcn_DW.xhat[i]);
    _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_mul_pd(_mm_set_pd(Phi[x_tmp_tmp + 1],
      Phi[x_tmp_tmp]), tmp_3), _mm_set_pd(Bearinghat, Rangehat)));
    Rangehat = tmp_1[0];
    Bearinghat = tmp_1[1];
    _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_mul_pd(_mm_set_pd(Phi[x_tmp_tmp + 3],
      Phi[x_tmp_tmp + 2]), tmp_3), _mm_set_pd(Phi_2, Phi_1)));
    Phi_1 = tmp_1[0];
    Phi_2 = tmp_1[1];
  }

  RadarTrackerFcn_DW.xhat[0] = Rangehat;
  RadarTrackerFcn_DW.xhat[1] = Bearinghat;
  RadarTrackerFcn_DW.xhat[2] = Phi_1;
  RadarTrackerFcn_DW.xhat[3] = Phi_2;
  Rangehat = sqrt(RadarTrackerFcn_DW.xhat[0] * RadarTrackerFcn_DW.xhat[0] +
                  RadarTrackerFcn_DW.xhat[2] * RadarTrackerFcn_DW.xhat[2]);
  Bearinghat = rt_atan2d_snf(RadarTrackerFcn_DW.xhat[2],
    RadarTrackerFcn_DW.xhat[0]);
  Phi_1 = sin(Bearinghat);
  Phi_2 = cos(Bearinghat);
  M[0] = Phi_2;
  M[2] = 0.0;
  M[4] = Phi_1;
  M[6] = 0.0;
  M[1] = -Phi_1 / Rangehat;
  M[3] = 0.0;
  M[5] = Phi_2 / Rangehat;
  M[7] = 0.0;
  _mm_storeu_pd(&RadarTrackerFcn_Y.residual[0], _mm_sub_pd(_mm_loadu_pd
    (&RadarTrackerFcn_U.meas[0]), _mm_set_pd(Bearinghat, Rangehat)));
  for (i = 0; i < 2; i++) {
    x_tmp_tmp = i << 2;
    x_tmp[x_tmp_tmp] = M[i];
    x_tmp[x_tmp_tmp + 1] = 0.0;
    x_tmp[x_tmp_tmp + 2] = M[i + 4];
    x_tmp[x_tmp_tmp + 3] = 0.0;
  }

  for (i = 0; i < 4; i++) {
    Rangehat = 0.0;
    Bearinghat = 0.0;
    for (x_tmp_tmp = 0; x_tmp_tmp < 4; x_tmp_tmp++) {
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&M[x_tmp_tmp << 1]),
        _mm_set1_pd(RadarTrackerFcn_DW.P[(i << 2) + x_tmp_tmp])), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
    }

    x_tmp_tmp = i << 1;
    W[x_tmp_tmp + 1] = Bearinghat;
    W[x_tmp_tmp] = Rangehat;
  }

  for (i = 0; i < 2; i++) {
    Rangehat = W[i + 2];
    Bearinghat = W[i];
    Phi_1 = W[i + 4];
    Phi_2 = W[i + 6];
    for (x_tmp_tmp = 0; x_tmp_tmp <= 0; x_tmp_tmp += 2) {
      j = (x_tmp_tmp + 1) << 2;
      Q_tmp = x_tmp_tmp << 2;
      tmp_4 = (x_tmp_tmp << 1) + i;
      tmp_5 = ((x_tmp_tmp + 1) << 1) + i;
      _mm_storeu_pd(&tmp_1[0], _mm_add_pd(_mm_add_pd(_mm_add_pd(_mm_add_pd
        (_mm_mul_pd(_mm_set_pd(x_tmp[j + 1], x_tmp[Q_tmp + 1]), _mm_set1_pd
                    (Rangehat)), _mm_mul_pd(_mm_set_pd(x_tmp[j], x_tmp[Q_tmp]),
        _mm_set1_pd(Bearinghat))), _mm_mul_pd(_mm_set_pd(x_tmp[j + 2],
        x_tmp[Q_tmp + 2]), _mm_set1_pd(Phi_1))), _mm_mul_pd(_mm_set_pd(x_tmp[j +
        3], x_tmp[Q_tmp + 3]), _mm_set1_pd(Phi_2))), _mm_set_pd(c_b[tmp_5],
        c_b[tmp_4])));
      x[tmp_4] = tmp_1[0];
      x[tmp_5] = tmp_1[1];
    }
  }

  if (fabs(x[1]) > fabs(x[0])) {
    Rangehat = x[0] / x[1];
    Bearinghat = 1.0 / (Rangehat * x[3] - x[2]);
    b[0] = x[3] / x[1] * Bearinghat;
    b[1] = -Bearinghat;
    b[2] = -x[2] / x[1] * Bearinghat;
    b[3] = Rangehat * Bearinghat;
  } else {
    Rangehat = x[1] / x[0];
    Bearinghat = 1.0 / (x[3] - Rangehat * x[2]);
    b[0] = x[3] / x[0] * Bearinghat;
    b[1] = -Rangehat * Bearinghat;
    b[2] = -x[2] / x[0] * Bearinghat;
    b[3] = Bearinghat;
  }

  for (i = 0; i < 2; i++) {
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (x_tmp_tmp = 0; x_tmp_tmp < 4; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      Q_tmp = (i << 2) + x_tmp_tmp;
      tmp_3 = _mm_set1_pd(x_tmp[Q_tmp]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&RadarTrackerFcn_DW.P[j]),
        tmp_3), _mm_set_pd(Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&RadarTrackerFcn_DW.P[j + 2]),
        tmp_3), _mm_set_pd(Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
      W[Q_tmp] = 0.0;
    }

    x_tmp_tmp = i << 2;
    tmp[x_tmp_tmp + 3] = Phi_2;
    tmp[x_tmp_tmp + 2] = Phi_1;
    tmp[x_tmp_tmp + 1] = Bearinghat;
    tmp[x_tmp_tmp] = Rangehat;
  }

  for (i = 0; i < 2; i++) {
    Q_tmp = i << 2;
    Rangehat = W[Q_tmp];
    Bearinghat = W[Q_tmp + 1];
    Phi_1 = W[Q_tmp + 2];
    Phi_2 = W[Q_tmp + 3];
    for (x_tmp_tmp = 0; x_tmp_tmp < 2; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      tmp_3 = _mm_set1_pd(b[(i << 1) + x_tmp_tmp]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&tmp[j]), tmp_3), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&tmp[j + 2]), tmp_3),
                         _mm_set_pd(Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
    }

    W[Q_tmp + 3] = Phi_2;
    W[Q_tmp + 2] = Phi_1;
    W[Q_tmp + 1] = Bearinghat;
    W[Q_tmp] = Rangehat;
  }

  Rangehat = RadarTrackerFcn_Y.residual[1];
  Bearinghat = RadarTrackerFcn_Y.residual[0];
  for (i = 0; i <= 2; i += 2) {
    tmp_3 = _mm_loadu_pd(&W[i + 4]);
    tmp_2 = _mm_loadu_pd(&W[i]);
    tmp_0 = _mm_loadu_pd(&RadarTrackerFcn_DW.xhat[i]);
    _mm_storeu_pd(&RadarTrackerFcn_DW.xhat[i], _mm_add_pd(_mm_add_pd(_mm_mul_pd
      (tmp_3, _mm_set1_pd(Rangehat)), _mm_mul_pd(tmp_2, _mm_set1_pd(Bearinghat))),
      tmp_0));
  }

  for (i = 0; i < 16; i++) {
    Phi[i] = 0;
  }

  Phi[0] = 1;
  Phi[5] = 1;
  Phi[10] = 1;
  Phi[15] = 1;
  memset(&Q[0], 0, sizeof(real_T) << 4U);
  for (j = 0; j < 4; j++) {
    Q_tmp = j << 2;
    Q[j + Q_tmp] = 1.0;
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (i = 0; i < 2; i++) {
      x_tmp_tmp = i << 2;
      tmp_3 = _mm_set1_pd(M[(j << 1) + i]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&W[x_tmp_tmp]), tmp_3),
                         _mm_set_pd(Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&W[x_tmp_tmp + 2]), tmp_3),
                         _mm_set_pd(Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
    }

    P_tmp[Q_tmp + 3] = Phi_2;
    P_tmp[Q_tmp + 2] = Phi_1;
    P_tmp[Q_tmp + 1] = Bearinghat;
    P_tmp[Q_tmp] = Rangehat;
  }

  for (i = 0; i <= 14; i += 2) {
    tmp_3 = _mm_loadu_pd(&Q[i]);
    tmp_2 = _mm_loadu_pd(&P_tmp[i]);
    _mm_storeu_pd(&Q_0[i], _mm_sub_pd(tmp_3, tmp_2));
  }

  for (i = 0; i < 4; i++) {
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (x_tmp_tmp = 0; x_tmp_tmp < 4; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      Q_tmp = (i << 2) + x_tmp_tmp;
      tmp_3 = _mm_set1_pd(RadarTrackerFcn_DW.P[Q_tmp]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&Q_0[j]), tmp_3), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&Q_0[j + 2]), tmp_3),
                         _mm_set_pd(Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
      j += i;
      Phi_0[Q_tmp] = (real_T)Phi[j] - P_tmp[j];
    }

    Q_tmp = i << 2;
    Q[Q_tmp + 3] = Phi_2;
    Q[Q_tmp + 2] = Phi_1;
    Q[Q_tmp + 1] = Bearinghat;
    Q[Q_tmp] = Rangehat;
  }

  for (i = 0; i < 2; i++) {
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (x_tmp_tmp = 0; x_tmp_tmp < 2; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      tmp_3 = _mm_set1_pd(c_b[(i << 1) + x_tmp_tmp]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&W[j]), tmp_3), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&W[j + 2]), tmp_3), _mm_set_pd
                         (Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
    }

    Q_tmp = i << 2;
    M[Q_tmp + 3] = Phi_2;
    M[Q_tmp + 2] = Phi_1;
    M[Q_tmp + 1] = Bearinghat;
    M[Q_tmp] = Rangehat;
  }

  for (i = 0; i < 4; i++) {
    Rangehat = 0.0;
    Bearinghat = 0.0;
    Phi_1 = 0.0;
    Phi_2 = 0.0;
    for (x_tmp_tmp = 0; x_tmp_tmp < 4; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      Q_tmp = (i << 2) + x_tmp_tmp;
      tmp_3 = _mm_set1_pd(Phi_0[Q_tmp]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&Q[j]), tmp_3), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&Q[j + 2]), tmp_3), _mm_set_pd
                         (Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
      P_tmp[Q_tmp] = 0.0;
    }

    Q_tmp = i << 2;
    Q_0[Q_tmp + 3] = Phi_2;
    Q_0[Q_tmp + 2] = Phi_1;
    Q_0[Q_tmp + 1] = Bearinghat;
    Q_0[Q_tmp] = Rangehat;
    Rangehat = P_tmp[Q_tmp];
    Bearinghat = P_tmp[Q_tmp + 1];
    Phi_1 = P_tmp[Q_tmp + 2];
    Phi_2 = P_tmp[Q_tmp + 3];
    for (x_tmp_tmp = 0; x_tmp_tmp < 2; x_tmp_tmp++) {
      j = x_tmp_tmp << 2;
      tmp_3 = _mm_set1_pd(W[j + i]);
      tmp_2 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&M[j]), tmp_3), _mm_set_pd
                         (Bearinghat, Rangehat));
      _mm_storeu_pd(&tmp_1[0], tmp_2);
      Rangehat = tmp_1[0];
      Bearinghat = tmp_1[1];
      tmp_3 = _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(&M[j + 2]), tmp_3), _mm_set_pd
                         (Phi_2, Phi_1));
      _mm_storeu_pd(&tmp_1[0], tmp_3);
      Phi_1 = tmp_1[0];
      Phi_2 = tmp_1[1];
    }

    P_tmp[Q_tmp + 3] = Phi_2;
    P_tmp[Q_tmp + 2] = Phi_1;
    P_tmp[Q_tmp + 1] = Bearinghat;
    P_tmp[Q_tmp] = Rangehat;
  }

  for (i = 0; i <= 14; i += 2) {
    tmp_3 = _mm_loadu_pd(&Q_0[i]);
    tmp_2 = _mm_loadu_pd(&P_tmp[i]);
    _mm_storeu_pd(&RadarTrackerFcn_DW.P[i], _mm_add_pd(tmp_3, tmp_2));
  }

  /* Outport: '<Root>/xhatOut' incorporates:
   *  MATLAB Function: '<Root>/RadarTrackerFcn'
   */
  RadarTrackerFcn_Y.xhatOut[0] = RadarTrackerFcn_DW.xhat[0];
  RadarTrackerFcn_Y.xhatOut[1] = RadarTrackerFcn_DW.xhat[1];
  RadarTrackerFcn_Y.xhatOut[2] = RadarTrackerFcn_DW.xhat[2];
  RadarTrackerFcn_Y.xhatOut[3] = RadarTrackerFcn_DW.xhat[3];
}

모델과 코드 간의 양방향 추적 기능을 통해 생성된 전체 코드를 자세한 HTML 리포트로 볼 수 있습니다.

web(fullfile(pwd,'RadarTrackerFcn_ert_rtw','html','index.html'))