- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
guys:
i use the intel visual fortran on the vs2010 to simulate with matlab2010,i have configured related path and lib.but have the problen as this:
votst.exe 0x7dd916d2 Most likely exception: 0xC0000005: Access vialation reading location at 0x0000000000000000.
votst.exe 0x7dd916d2 There are unhandled exceptions: 0xC0000005: Access vialation reading location at 0x0000000000000000.
the program code :
program testpf
implicit none
integer*8,external :: engOpen,engClose,mxCreateDoubleMatrix
integer*8,external :: mxGetPr,engPutVariable,engEvalString
integer*8,external :: engGetVariable,mxFreeMatrix
integer*8 ep,TT,D,t
double precision time(10),dist(10)
integer temp,status,i
data time/1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0/
ep = engOpen('matlab')
TT = mxCreateDoubleMatrix(1,10,0)
call mxCopyReal8ToPtr(time,mxGetPr(TT),10)
status = engPutVariable(ep,T)
t = engEvalString(ep,'DD=.5. *(-9.8).*TT.2; ')
t = engEvalString(ep,'plot(TT,D);')
t = engEvalString(ep,'title("Postion vs Time")')
t = engEvalString(ep,'xlabel("Time(Seconds)")')
t = engEvalString(ep,'ylabel("Position(meters)")')
read(*,*)
t = engEvalString(ep,'close;')
D=engGetVariable(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 *,time(i),dist(i)
10 continue
! t= mxFreeMatrix(TT)
! t= mxFreeMatrix(D)
t = engClose(ep)
stop
end
thanks a lot
Link Copied

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page