User`s manual
4 Calling MATLAB from C and Fortran Programs
4-14
C
D = engGetMatrix(ep, 'D')
call mxCopyPtrToReal8(mxGetPr(D), dist, 10)
print *, 'MATLAB computed the following distances:'
print *, ' time(s) distance(m)'
do 10 i=1,10
print 20, time(i), dist(i)
20 format(' ', G10.3, G10.3)
10 continue
C
C
call mxFreeMatrix(T)
call mxFreeMatrix(D)
status = engClose(ep)
C
if (status .ne. 0) then
write(6,*) 'engClose failed'
stop
endif
C
stop
end
Executing this program launches MATLAB, sends it data, and plots the
results.