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

« back to all changes in this revision

Viewing changes to macros/m2sci/sci_line.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 [stk,txt,top]=sci_line()
2
 
// Copyright INRIA
3
 
txt=[]
4
 
options=[]
5
 
if rhs>2 then
6
 
  top=top-rhs+2
7
 
  rhs=2
8
 
  options=[]
9
 
end
10
 
//x argument
11
 
if stk(top-1)(3)=='1'|stk(top-1)(4)=='1' then
12
 
  if isname(stk(top-1)(1)) then 
13
 
    x=stk(top-1)(1)
14
 
    txt=[txt;x+' = '+x+'(:)']
15
 
  else
16
 
    x=gettempvar(1)
17
 
    txt=[txt;x+' = '+stk(top-1)(1)+';'+x+' = '+x+'(:)']
18
 
  end
19
 
else 
20
 
  if isname(stk(top-1)(1)) then 
21
 
    x=stk(top-1)(1),
22
 
  else
23
 
    x=gettempvar(1)
24
 
    txt=[txt;x+' = '+stk(top-1)(1)]
25
 
  end
26
 
  txt=[txt;
27
 
      'if min(size('+x+'))==1 then'
28
 
      '  '+x+' = '+x+'(:)*ones(1,size('+y+',2))'
29
 
      'end']
30
 
end
31
 
//y argument
32
 
if stk(top)(3)=='1'|stk(top)(4)=='1' then
33
 
  if isname(stk(top)(1)) then 
34
 
    y=stk(top-1)(1)
35
 
    txt=[txt;y+' = '+y+'(:)']
36
 
  else
37
 
    y=gettempvar(1)
38
 
    txt=[txt;y+' = '+stk(top)(1)+';'+y+' = '+y+'(:)']
39
 
  end
40
 
else 
41
 
  if isname(stk(top)(1)) then 
42
 
    y=stk(top)(1),
43
 
  else
44
 
    y=gettempvar(1)
45
 
    txt=[txt;y+' = '+stk(top)(1)]
46
 
  end
47
 
  txt=[txt;
48
 
      'if min(size('+y+'))==1 then'
49
 
      '  '+y+' = '+y+'(:)*ones(1,size('+x+',2))'
50
 
      'end']
51
 
end
52
 
 
53
 
txt=[txt;'xpolys'+rhsargs([x,y,options])]
54
 
top=top-1
55
 
stk=list(' ','-2','0','0','0')
56
 
 
57
 
 
58
 
 
59