From: Mark on
I'm trying to create a small fortran subroutine that will use the matlab engine to read some ascii array, allocate a fortran array and copy the data into it. I'm getting this error on the engEvalString(load...) part:

??? Error using ==> load
Can't read file stdio.


Code below. Any help appreciated.


subroutine ReadArray( A, mengHandle, filename )
real*8, allocatable, intent(inout) :: A(:)
integer*8, intent(in) :: mengHandle, status
character* (*), intent(in) :: filename

character(len=255) :: string
integer*8 :: Am, engGetVariable, engPutVariable, status, engEvalString, len
integer*8 :: mxCreateDoubleMatrix, mxGetPr
integer*8 :: size, matOpen

Am = mxCreateDoubleMatrix( 32, 1, 0 )
status = engPutVariable( mengHandle, 'A', Am )
string = "A=load('" // filename // "');"
status = engEvalString( mengHandle, string )

[......]

end subroutine
From: Mark on
edit: mis-copy in the post. "status" isn't in the "intent(in)" section.