About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 5 years ago
  • Total downloads: 71
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Xianyao Chen
See full specifications

scripts default iconMatData (Scripts) Publisher's description

where "filename" is the string of .mat file's name, "varname" is the string of variable's name stored in

MatData 1.02


call read(filename,varname,var)
call write(filename,varname,var,action)

where "filename" is the string of .mat file's name, "varname" is the string of variable's name stored in .mat file, "var" is the variable's name in Fortran program, which can be any one of the following type: 0~3 dimensions, integer(kind=2) or real(kind=4) variables, or string. Other kind of variables will be supported in future.

"action" is character(len=1), optional variable ('w' or 'a'), which denotes create or append the data file "filename". If the file doesnot exist, it will be created.

Examples to use this module in Fortran 90/95:

If want to output a two-dimensional array Temp(100,200) into matlab data file result.mat, use following code:

use matdata
... ...
call write('result.mat','Temperature',temp,'w')
... ...

When read this data into another variable temp2(100,200), using

... ...
call read('result.mat','Temperature',temp2)
... ...

Since MATLAB is case-sensitive whereas Fortran is not, "varname" shoule be case-sensitive.

When compile this Fortran program, MATLAB supported .dll and .lib files libmat.dll libmat.lib libmx.dll libmx.lib libut.dll
must be in the bin and lib path, and following command line is requried:

f90 ... matdata.f90 ... libmat.lib libmx.lib

Update, May 25, 2004:

New functions are added into the module, which include read/write one-dimensional matrix of strings.
For example, in order to read/write character(len=100), dimension(100) :: name into result.mat file,
use following code:
call write('result.mat','name',name,'w')
call read ('result.mat','name',name)

One thing should be noted: because Fortran and Matlab use different way to store string array, the subroutine to read
the string array from .mat file to Fortran array use an un-efficient algorithm, if anyone has new idea to improve it,
please contact with me. And also, with this algorithm, unicode output is invalid, evenif both Fortran and Matlab support
unicode string. I hope someone can help me to find an efficient algorithm to input/output unicode string to/from .mat file.

Update, Sep. 24, 2004:

New functions are added to the module, which includes:
1) integer(kind=2) and real(kind=8) (double precision)
2) four-dimensions array for all kinds of data type

In order to read .mat file created by Matlab Ver 7, -V6 option should be used, for example: save -mat -V6 [variable lists]

System Requirements:

MATLAB 6.5 (R13)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Is MatData (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.