Subsections


Sample and hold

\epsfig{file=SAMPLEHOLD.eps,width=90.00pt}

Library

Linear

Description

Each time an input event is received block copy its input on the output and hold it until input event. For periodic Sample and hold, event input must be generated by a Clock.

Default properties

Interfacing function

scilab/macros/scicos_blocks/linear/SAMPLEHOLD.sci

Computational function (type 4)


  
#include "scicos_block.h"

void samphold4(scicos_block *block,int flag)
{
  /* c     Copyright INRIA
     
  Scicos block simulator
  returns sample and hold  of the input */
  
  int i;
  if (flag ==1){
    for (i=0;iinsz[0];i++) 
      block->outptr[0][i]=block->inptr[0][i];
  }
}


Ramine Nikoukhah 2004-06-22