For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2005 > How to read matlab .mat files with Absoft90 fortran









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to read matlab .mat files with Absoft90 fortran
cfox

2005-12-14, 3:17 pm

Hi

I am trying to read a matlab .mat file using the absoft 9.0
fortran 90 compiler. I have a code from mathworks called
MatData.f90 which should enable me to read and write to a
.mat file. However I am having problems with the compilation.
the readme file says the folowing

When compiling 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

I compiled using
f90 MatData.f90 -L libmat.lib -L libmx.lib
but I get several errors regarding unreferenced matlab variables
MXGETPR, MXCLASSIDFROMCLASSNAME etc that are defined as
integer(kind=4)::mxGetPr,mxGetString

a .MOD file is created but when I try to call it I get errors
regarding the matlab functions
called using

call matread('filename','vartoextract',namegi
ventovar)

I am fairly new to Fortran so any help in solving this problem would be great

Cheers

CHRIS
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com