File: ZCROSS_f.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (49 lines) | stat: -rw-r--r-- 1,184 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
function [x,y,typ]=ZCROSS_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);
  while %t do
    [ok,in,label]=getvalue(['Set Zero-Crossing parameters';..
	                    'All surfaces must cross together'],..
			    'Input size',list('vec',1),label)
    if ~ok then break,end
    in=int(in)
    if in<=0 then
      message('Block must have at least one input')
    else
      kk=0
      for jj=1:in
	kk=kk+2^(in+jj-1)
      end
      model(8)=[-ones(kk,1);zeros(2^(2*in)-kk,1)]
      graphics(4)=label
      model(2)=in
      model(11)=-1 //compatibility
      x(2)=graphics;x(3)=model
      break
    end
  end
case 'define' then
  rpar=[-1;-1;0;0]
  in=1
  model=list('zcross',in,[],[],1,[],[],rpar,[],'z',-1,[%t %f],' ',list())
  label=strcat(sci2exp(in))
  gr_i=['xstringb(orig(1),orig(2),''Zcross'',sz(1),sz(2),''fill'');']
  x=standard_define([2 2],model,label,gr_i)
end