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

📄 exm09222_1_acc.c

📁 精通matlab
💻 C
字号:
#if 0

This file is not available for use in any application other than as a
Matlab(R) MEX file for use with the Simulink(R) Accelerator product.

If you do not have the Real-Time Workshop licensed, this file contains
encrypted block names, etc. If you purchase the Real-Time Workshop,
this file will contain full block descriptions and improved variable
names.

#endif

/*
 * exm09222_1_acc.c
 *
 * Real-Time Workshop code generation for Simulink model "exm09222_1_acc.mdl".
 *
 * Model Version                        : 1.3
 * Real-Time Workshop file version      : 4.0 $Date: 2000/09/19 19:45:27 $
 * Real-Time Workshop file generated on : Sat Aug 11 16:23:12 2001
 * TLC version                          : 4.0 (Aug 21 2000)
 * C source code generated on           : Sat Aug 11 16:23:12 2001
 *
 * Relevant TLC Options:
 *   InlineParameters      = 0
 *   RollThreshold         = 5
 *   CodeFormat            = S-Function
 *
 * Simulink model settings:
 *   Solver     : VariableStep
 *   StartTime  : 0.0 s
 *   StopTime   : 10.0 s
 *   Variable step solver used
 */

#include <math.h>
#include <string.h>
#include "exm09222_1_acc.h"
#include "exm09222_1_acc_prm.h"

/* Start of Functions in model "exm09222_1_acc" */

/* Compute block outputs */
static void mdlOutputs(SimStruct *S, int_T tid)
{
  /* simstruct variables */
  exm09222_1_BlockIO *exm09222_1_B = (exm09222_1_BlockIO *) _ssGetBlockIO(S);
  exm09222_1_Parameters *exm09222_1_P = (exm09222_1_Parameters *) ssGetDefaultParam(S);

  /* SignalGenerator Block: <Root>/Signal Generator */
  {
    real_T phase = (exm09222_1_P->Signal_Generator_Frequency)*ssGetT(S);
    phase = 1.0-2.0*(phase-floor(phase));
    exm09222_1_B->w_t = (exm09222_1_P->Signal_Generator_Amplitude)*phase;
  }

  /* Sin Block: <Root>/Sine Wave */
  exm09222_1_B->s_t = (exm09222_1_P->Sine_Wave_Amp) *
    sin((exm09222_1_P->Sine_Wave_Freq) * ssGetT(S) + (exm09222_1_P->Sine_Wave_Phase));

  /* Scope Block: <Root>/Scope */
  /* Call into Simulink for Scope */
  ssCallAccelRunBlock(S, 0, 2, SS_CALL_MDL_OUTPUTS);
}

/* Perform model update */
#define MDL_UPDATE
static void mdlUpdate(SimStruct *S, int_T tid)
{
  /* (no update code required) */
}

/* End of Functions in model "exm09222_1_acc" */

#include "exm09222_1_acc_reg.h"

/* [EOF] exm09222_1_acc.c */

⌨️ 快捷键说明

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