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

« back to all changes in this revision

Viewing changes to macros/mtlb/mtlb_min.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 [r,k]=mtlb_min(a,b,c)
 
2
// Copyright INRIA
 
3
[lhs,rhs]=argn(0);
 
4
if rhs==1 then //min(A)
 
5
  if ~isreal(a,0) then 
 
6
    if size(a,1)==1|size(a,2)==1 then
 
7
      [r,k]=min(abs(a))
 
8
      r=a(k)
 
9
    else
 
10
      [r,k]=min(abs(a),'r')
 
11
      r=a(k,:)
 
12
    end
 
13
  else
 
14
    a=real(a)
 
15
    if size(a,1)==1|size(a,2)==1 then
 
16
      [r,k]=min(a)
 
17
    else
 
18
      [r,k]=min(a,'r')
 
19
    end
 
20
  end
 
21
elseif rhs==3 then //min(A,[],num) with num>2
 
22
  error('not yet implemented') 
 
23
end