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

« back to all changes in this revision

Viewing changes to macros/percent/%hm_size.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
1
function varargout=%hm_size(M,job)
2
2
// Copyright INRIA
3
3
// returns dimensions of an hyper matrix
4
 
 
5
 
 
6
4
[lhs,rhs]=argn(0)
7
 
dims=M('dims')
 
5
dims=matrix(double(M.dims),1,-1)
8
6
if rhs==2 then
9
7
  if job=='*' then
10
8
    varargout(1)=prod(dims)
21
19
  return
22
20
end
23
21
if lhs==1 then
24
 
  varargout(1)=dims'
 
22
  varargout(1)=matrix(dims,1,-1)
25
23
else
26
24
  if lhs>size(dims,'*') then error('Too many LHS args'),end
27
25
  for k=1:lhs
28
26
    varargout(k)=dims(k)
29
27
  end
30
28
end
 
29
endfunction