I am trying to use matOpen to open and read .mat file but I got this error. Anyone can help me? Here is my code:
real(8), allocatable :: b(:,:)
character(40) :: text
end program reading
You have IMPLICIT NONE, and the name matOpen has not been declared. That is the reason for the message. The program that you showed does not use the variable mp anywhere else, so you could simply remove the matOpen statement. Your program does not make much sense, because it opens a Matlab .mat file for reading, and writes the uninitialized variable b to a text file without going through the Matlab API functions.
On the other hand, if you wish to actually read a Matlab .mat file, you need to consult the Matlab documentation regarding how to do that from Fortran. See the two examples matDemo1.f and matDemo2.f in the extern\examples directory.