Create MAT-File in Fortran

The matdemo1.F example creates the MAT-file, matdemo.mat. To see the code, you can open the fileopen the file in MATLAB® Editor.

After building the program, run the application. This program creates a MAT-file, matdemo.mat, that you can load into MATLAB. To run the application, depending on your platform, either double-click its icon or type matdemo1 at the system prompt:

Creating MAT-file matdemo.mat ...
Done creating MAT-file

To verify the MAT-file, at the command prompt, type:

whos -file matdemo.mat
  Name               Size            Bytes  Class     Attributes

  Numeric            3x3                72  double              
  NumericGlobal      3x3                72  double    global    
  String             1x33               66  char                

    Note:   For an example of a Microsoft® Windows® standalone program (not MAT-file specific), see engwindemo.c in the matlabroot\extern\examples\eng_mat folder.

Related Examples

Was this topic helpful?