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

📄 expandpnseq_wrapper.c

📁 CDMA2000的仿真平台,使用MATLAB设计完成
💻 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 + -