File: GENERAL_f.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 (57 lines) | stat: -rw-r--r-- 1,469 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function [x,y,typ]=GENERAL_f(job,arg1,arg2)
// Copyright INRIA
x=[];y=[];typ=[];
select job
case 'plot' then
  standard_draw(arg1)
case 'getinputs' then
  [x,y,typ]=standard_inputs(arg1)
case 'getoutputs' then
  [x,y,typ]=standard_outputs(arg1)
case 'getorigin' then
  [x,y]=standard_origin(arg1)
case 'set' then
  x=arg1;
  graphics=arg1(2);label=graphics(4)
  model=arg1(3);rpar=model(8)
  in=model(2);out=model(5)
  nin=sum(in)
  nout=sum(out)
    [ok,in,out,label]=getvalue('Set General Zero-Crossing parameters',..
      ['Input size';
       'Number of event output'],..
      list('vec',1,'vec',1),label)
  if ok then
    [model,graphics,ok]=check_io(model,graphics,in,[],[],ones(out,1))
    if ok then
      nout1=out
      nin1=in
      if nout==nout1 & nin==nin1 then
	rp=matrix(rpar,nout,2^(2*nin));
      else
	rp=-1*ones(nout1,2^(2*nin1))
      end
      n=size(rp,2)/2
      result=x_mdialog('routing matrix',string(1:nout1),..
	  string(1:2^(2*nin1)),string(rp(:,:)))
      if result<>[] then
	rp(1:nout1,1:2*n)=evstr(result)
	model(8)=rp(:)
	model(11)=-ones(out,1)
	graphics(4)=label
	x(2)=graphics;x(3)=model
      end
    end
  end
case 'define' then
  rpar=[0;0;0;0]
  in=1;out=1;
  model=list('zcross',in,[],[],ones(out,1),[],[],rpar,[],'z',-ones(out,1),[%t %f],' ',list())
  label=[strcat(sci2exp(in));strcat(sci2exp(out))]
  gr_i=['xstringb(orig(1),orig(2),''GENERAL'',sz(1),sz(2),''fill'');']
  x=standard_define([3 2],model,label, gr_i)
end