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

« back to all changes in this revision

Viewing changes to macros/m2sci/sci_zeros.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_zeros()
2
 
// Copyright INRIA
3
 
txt=[]
4
 
if rhs==0 then
5
 
  stk=list('0','0','1','1','1','?')
6
 
  top=top+1
7
 
elseif rhs==1 then
8
 
  [m,n]=checkdims(stk(top))
9
 
  if m==1&n==1 then
10
 
    stk=list('zeros('+stk(top)(1)+','+stk(top)(1)+')','0',stk(top)(1),stk(top)(1),'1','?')
11
 
  elseif m*n==2 then
12
 
    temp=gettempvar()
13
 
    txt=temp+'='+stk(top)(1)
14
 
    stk=list('zeros('+temp+'(1),'+temp+'(2))','0','?','?','1','?')
15
 
  else
16
 
    set_infos([
17
 
        'mtlb_zeros('+stk(top)(1)+') can be replaced by :'
18
 
        ' zeros('+stk(top)(1)+','+stk(top)(1)+') if '+stk(top)(1)+' is a scalar'
19
 
        ' zeros(v(1),v(2),''n'') if '+stk(top)(1)+' is the vector v'],1)
20
 
    stk=list('mtlb_zeros('+stk(top)(1)+')','0','?','?','1','?')
21
 
  end
22
 
else
23
 
  stk=list('zeros('+stk(top-1)(1)+','+stk(top)(1)+')','0',stk(top-1)(1),stk(top)(1),'1','?')
24
 
  top=top-1
25
 
end
26
 
 
27