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

« back to all changes in this revision

Viewing changes to macros/mtlb/mtlb_rand.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 r=mtlb_rand(a,opt)
 
1
function r=mtlb_rand(a)
2
2
// Copyright INRIA
3
 
[lhs,rhs]=argn()
4
 
if rhs==1 then
5
 
  if and(size(a)==[1 1]) then
6
 
    r=rand(a,a)
7
 
  else
8
 
    r=rand(a(1),a(2))
9
 
  end
 
3
// Emulation function for rand() Matlab function
 
4
// V.C.
 
5
 
 
6
if and(size(a)==[1 1]) then
 
7
  r=rand(a,a)
10
8
else
11
 
  if and(size(a)==[1 1]) then
12
 
    r=rand(a,a,opt)
13
 
  else
14
 
    r=rand(a(1),a(2),opt)
 
9
  tmp=list()
 
10
  for k=1:size(a,"*")
 
11
    tmp(k)=a(k)
15
12
  end
 
13
  r=rand(tmp(1:$))
16
14
end
 
15
endfunction