~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/scicos_blocks/BIGSOM_f.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function [x,y,typ]=BIGSOM_f(job,arg1,arg2)
2
 
// Copyright INRIA
3
 
x=[];y=[];typ=[];
4
 
select job
5
 
case 'plot' then
6
 
  standard_draw(arg1)
7
 
case 'getinputs' then
8
 
  [x,y,typ]=standard_inputs(arg1)
9
 
case 'getoutputs' then
10
 
  [x,y,typ]=standard_outputs(arg1)
11
 
case 'getorigin' then
12
 
  [x,y]=standard_origin(arg1)
13
 
case 'set' then
14
 
  x=arg1;
15
 
  [graphics,model]=arg1(2:3);
16
 
  label=graphics(4)
17
 
  while %t do
18
 
    [ok,sgn,label]=getvalue('Set sum block parameters',..
19
 
                           'Inputs ports signs/gain',list('vec',-1),label)
20
 
    if ~ok then break,end
21
 
    in=-ones(size(sgn,'*'),1)
22
 
    [model,graphics,ok]=check_io(model,graphics,in,-1,[],[])
23
 
    model(8)=sgn(:)
24
 
    graphics(4)=label
25
 
    x(2)=graphics;x(3)=model
26
 
    break
27
 
  end
28
 
case 'define' then
29
 
  sgn=[1;1]
30
 
  model=list(list('sum',2),[-1;-1],-1,[],[],[],[],sgn,[],'c',[],[%t %f],' ',list())
31
 
  label=sci2exp(sgn)
32
 
   gr_i=['[x,y,typ]=standard_inputs(o) ';
33
 
          'sgn=o(3)(8)';
34
 
          'for k=1:size(x,''*'')';
35
 
          '  if sgn(k)>0 then';
36
 
          '    xstring(orig(1)+sz(1)/8 ,y(k)-4,''+'')';
37
 
          '  else';
38
 
          '    xstring(orig(1)+sz(1)/8 ,y(k)-4,''-'')';
39
 
          '  end';
40
 
          'end';
41
 
          'xx=sz(1)*[.8 .4 0.75 .4 .8]+orig(1)';
42
 
          'yy=sz(2)*[.8 .8 .5 .2 .2]+orig(2)';
43
 
          'xpoly(xx,yy,''lines'')']
44
 
  x=standard_define([2 3],model,label,gr_i)
45
 
end
46
 
 
47
 
 
48
 
 
49