/* Copyright 2002 The MathWorks, Inc. */ /* $Revision: 1.1.4.1 $ */ /* * * --- THIS FILE GENERATED BY S-FUNCTION BUILDER: 2.0 --- * * This file is a wrapper S-function produced by the S-Function * Builder which only recognizes certain fields. Changes made * outside these fields will be lost the next time the block is * used to load, edit, and resave this file. This file will be overwritten * by the S-function Builder block. If you want to edit this file by hand, * you must change it only in the area defined as: * * %%%-SFUNWIZ_wrapper_XXXXX_Changes_BEGIN * Your Changes go here * %%%-SFUNWIZ_wrapper_XXXXXX_Changes_END * * For better compatibility with the Real-Time Workshop, the * "wrapper" S-function technique is used. This is discussed * in the Real-Time Workshop User's Manual in the Chapter titled, * "Wrapper S-functions". * * Created: Thu May 16 10:32:22 2002 */ /* * Include Files * */ #include "tmwtypes.h" /* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */ #include #define NUM_OF_ELEMENTS 6 /* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */ #define u_width 2 #define y_width 3 /* * Create external references here. * */ /* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */ /* extern double func(double a); */ /* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */ /* * Output functions * */ void sfbuilder_mport_Outputs_wrapper(const real32_T *in1, const int32_T *in2, int8_T *out1, creal32_T *out2) { /* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */ /*Please note that Matrix signals are stored in column major order.*/ /* First Output Port * out1 = in1 + in2 */ int i; for(i = 0; i < NUM_OF_ELEMENTS ; i++) { /* Add the two input matrices*/ out1[i] = (int8_T) (in1[i]) + (int8_T) (in1[i]); } /*Second Output Port * Real part of out2 = in1; * Imaginary part of out2 = in2; */ for(i = 0; i < NUM_OF_ELEMENTS ; i++) { out2[i].re = in1[i]; out2[i].im = (real32_T) in2[i]; } /* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */ } /* * Updates function * */ void sfbuilder_mport_Update_wrapper(const real32_T *in1, const int32_T *in2, const int8_T *out1, const creal32_T *out2 ) { /* %%%-SFUNWIZ_wrapper_Update_Changes_BEGIN --- EDIT HERE TO _END */ /* * Code example * xD[0] = u0[0]; */ /* %%%-SFUNWIZ_wrapper_Update_Changes_END --- EDIT HERE TO _BEGIN */ } /* * Derivatives function * */ void sfbuilder_mport_Derivatives_wrapper(const real32_T *in1, const int32_T *in2, const int8_T *out1, const creal32_T *out2, real_T *dx ) { /* %%%-SFUNWIZ_wrapper_Derivatives_Changes_BEGIN --- EDIT HERE TO _END */ /* * Code example * dx[0] = xC[0]; */ /* %%%-SFUNWIZ_wrapper_Derivatives_Changes_END --- EDIT HERE TO _BEGIN */ }