delay4.c File Reference

#include "scicos_block.h"

Include dependency graph for delay4.c:

Go to the source code of this file.

Functions

void delay4 (scicos_block *block, int flag)


Function Documentation

void delay4 ( scicos_block block,
int  flag 
)

Definition at line 3 of file delay4.c.

References i, scicos_block::inptr, scicos_block::nz, scicos_block::outptr, y, scicos_block::z, and z.

00004 {
00005   /* Copyright INRIA
00006    
00007      Scicos block simulator
00008      Ouputs nx*dt delayed input */
00009 
00010   double* y=block->outptr[0];
00011   double* z=block->z;
00012   int nz=block->nz;
00013   double* u=block->inptr[0];
00014   
00015   int i;
00016   
00017   if (flag ==1 || flag ==4 || flag ==6){
00018     y[0]=z[0];
00019   }else if (flag == 2){
00020     /*  shift buffer */
00021     for (i=0; i<=nz-2; i++){
00022       z[i]=z[i+1];
00023     }
00024     /* add new point to the buffer */
00025     z[nz-1]=u[0];
00026   }
00027 }


Generated on Sun Mar 4 16:12:02 2007 for Scilab [trunk] by  doxygen 1.5.1