?? expandpnseq_wrapper.c
字號:
/*
*
* --- 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: Tue Jul 9 23:38:33 2002
*/
/*
* Include Files
*
*/
#include "tmwtypes.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#include <math.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 32767
#define y_width 1
/*
* 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 expandPNSeq_Outputs_wrapper(const real_T *inPN,
real_T *outPN,
const real_T *polOrder, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
int k,j,inCount,outCount, count, notFound;
double tmp[14];
double sum;
/* Initilize counters */
inCount = 0;
outCount = 0;
count = 0;
/* Reset flag */
notFound = 1;
/* Reset intermediate variables */
for(k=0;k<14;k++) tmp[k]=-5;
/* 32767 corresponds to 2^15-1 */
for (k=0; k<32767; k++)
{
/* Update Output */
outPN[outCount] = inPN[inCount];
if(notFound)
{
tmp[k%14] = inPN[inCount];
/* Look for 14 zeros */
for(j=0, sum=0; j<14; j++) sum +=tmp[j];
if(sum == 0)
{
outPN[outCount] = 0;
outCount ++;
notFound = 0;
}
}
/* Increment counters */
outCount ++;
inCount ++;
}
/* For security */
if(notFound) outPN[32767] = -5;
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
/*
* Updates function
*
*/
void expandPNSeq_Update_wrapper(const real_T *inPN,
const real_T *outPN,
const real_T *polOrder, const int_T p_width0)
{
/* %%%-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 expandPNSeq_Derivatives_wrapper(const real_T *inPN,
const real_T *outPN,
real_T *dx,
const real_T *polOrder, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Derivatives_Changes_BEGIN --- EDIT HERE TO _END */
/*
* Code example
* dx[0] = xC[0];
*/
/* %%%-SFUNWIZ_wrapper_Derivatives_Changes_END --- EDIT HERE TO _BEGIN */
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -