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

« back to all changes in this revision

Viewing changes to macros/mtlb/mtlb_type.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 []=mtlb_type(filename)
 
2
// Copyright INRIA
 
3
// Emulation function for type() Matlab function
 
4
// V.C.
 
5
[x,ierr]=fileinfo(filename)
 
6
if ierr==0 then // File exists
 
7
  disp(mgetl(mopen(filename,"r")))
 
8
else
 
9
  if type(evstr(filename))==13 then // Compiled function
 
10
    disp(fun2string(evstr(filename)))
 
11
  elseif strindex(filename,".")==[] then // File without extension
 
12
    Mfilename=filename+".m"
 
13
    [x,ierr]=fileinfo(Mfilename)
 
14
    if ierr==0 then // filename.m exists
 
15
      disp(mgetl(mopen(Mfilename,"r")))
 
16
    else
 
17
      SCIfilename=filename+".sci"
 
18
      [x,ierr]=fileinfo(SCIfilename)
 
19
      if ierr==0 then // filename.sci exists
 
20
        disp(mgetl(mopen(SCIfilename,"r")))
 
21
      else
 
22
        disp("Could not open neither "+filename+" nor "+Mfilename+" nor "+SCIfilename); 
 
23
      end
 
24
    end
 
25
  end
 
26
end
 
27
endfunction