User`s manual

6 Importing and Exporting Data
6-24
Once you have compiled and linked your MAT-file program, you can run the
stand-alone application you have just produced. This program creates a
MAT-file,
matdemo.mat, that can be loaded into MATLAB. To run the
application, depending on your platform, either double-click on its icon or enter
matdemo1 at the system prompt.
matdemo1
Creating MAT-file matdemo.mat ...
Done creating MAT-file
To verify that the MAT-file has been created, at the MATLAB prompt enter
whos -file matdemo.mat
Name Size Bytes Class
Numeric 3x3 72 double array
String 1x33 66 char array
Grand total is 42 elements using 138 bytes
Note For an example of a Windows stand-alone program (not MAT-file
specific), see
engwindemo.c in the <matlab>\extern\examples\eng_mat
directory.
Reading a MAT-File in Fortran
This sample program illustrates how to use the library routines to read in the
MAT-file created by
matdemo1.f and describe its contents.
C matdemo2.f
C
C This is a simple program that illustrates how to call the
C MATLAB MAT-file functions from a Fortran program. This
C demonstration focuses on reading MAT-files. It reads in
C the MAT-file created by matdemo1.f and describes its
C contents.
C
C Copyright (c) 1996-2000 The MathWorks, Inc.
C