~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/m2sci/sci_hanning.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [stk,txt,top]=sci_hanning()
 
2
// Copyright INRIA
 
3
txt=[]
 
4
if rhs==1 then
 
5
 stk=list('window(''hn'','+stk(top)(1)+')''','0',stk(top)(1),'1','1')
 
6
else
 
7
  sflag=stk(top)(1)
 
8
  top=top-1
 
9
  if sflag=='symmetric' then
 
10
    stk=list('window(''hn'','+stk(top)(1)+')''','0',stk(top)(1),'1','1')
 
11
  elseif sflag=='periodic' then
 
12
    if lst(ilst+1)(1)=='1' then  //affected result
 
13
      w=lhsvarsname()
 
14
    else
 
15
      w=gettempvar()
 
16
    end
 
17
    txt=[w+' = window(''hn'','+stk(top)(1)+'+1)''';
 
18
         w+' = '+w+'(1:$-1)']
 
19
 
 
20
    stk=list(' ','-2',stk(top)(1),'1','1')
 
21
  else
 
22
    if lst(ilst+1)(1)=='1' then  //affected result
 
23
      w=lhsvarsname()
 
24
    else
 
25
      w=gettempvar()
 
26
    end 
 
27
    txt=['if '+sflag+'==''periodic'' then'
 
28
         '  '+w+' = window(''hn'','+stk(top)(1)+'+1)'''
 
29
         '  '+w+' = '+w+'(1:$-1)'
 
30
         'else'
 
31
         '  '+w+' = window(''hn'','+stk(top)(1)+')'''
 
32
         'end']
 
33
    stk=list(' ','-2',stk(top)(1),'1','1')
 
34
  end
 
35
end