File: m_sin.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (36 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function [out1,out2]=m_sin(t,x,z,up,uc,clock,flag,rpar,ipar)
//if flag>0 then write(0,'m_sin t='+string(t)+' flag ='+string(flag)),end
// Copyright INRIA
out1=[];out2=[];
select flag
case 1 then
  out1=sin(rpar(1)*t+rpar(2))
case 2 then
   message('?')
case 3 then 
  message('?')
case -1 then //initialisation
  model=t
  label='Sin'
  state=[]
  dstate=[]
  rpar=[1;0]
  model=list(model(1),[],1,[],[],state,dstate,rpar,[],'c',-1,[%f %t],' ',list())
  out1=list(model,label)
case -2 then //update
  model=t
  label=x
  if label==[] then
    [ok,gain,phase,label1]=getvalue('Set Sin block parameters',..
	['Frequency';'Phase'],list('vec',1,'vec',1))
  else
  
    [ok,gain,phase,label1]=getvalue('Set Sin block parameters',..
	['Frequency';'Phase'],list('vec',1,'vec',1),label)
  end
  if ok then
    model(8)=[gain;phase]
    label=label1
  end
  out1=list(model,label)
end