Subsections
Gain
Linear
This block is a gain block. The output is the Gain times the regular
input (vector). The dimensions of Gain determines the input (number of
columns) and output (number of rows) port sizes.
| Set gain block parameters |
|
| Gain |
1 |
- always active: no
- direct-feedthrough: yes
- zero-crossing: no
- mode: no
- number/sizes of inputs: 1 / -1
- number/sizes of outputs: 1 / -1
- number/sizes of activation inputs: 0 /
- number/sizes of activation outputs: 0 /
- continuous-time state: no
- discrete-time state: no
- name of computational function: gainblk
scilab/macros/scicos_blocks/linear/GAINBLK.sci
#include "scicos_block.h"
#include <math.h>
#include "../machine.h"
extern void C2F(dmmul)();
void gainblk(scicos_block *block,int flag)
{
int i,un=1;
if (block->nrpar==1){
for (i=0;i<block->insz[0];++i){
block->outptr[0][i]=block->rpar[0]*block->inptr[0][i];
}
}else{
C2F(dmmul)(block->rpar,&block->outsz[0],block->inptr[0],
&block->insz[0],block->outptr[0],&block->outsz[0],
&block->outsz[0],&block->insz[0],&un);
}
}
Ramine Nikoukhah
2004-06-22