- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm doing matlab calculation with visual fortran 90. Now ihave a strange error.
When i use the ** symbol my mex dll crashes. without the ** it works great.
also the5 ** 2 works great (propably becouse optimalization makes it a5 * 5) but5 ** 0.25 dosn't work.
My testing code
REAL*8 FUNCTION T4_p(p)
IMPLICIT NONE
REAL*8 betaREAL*8 p
beta = p ** 0.25 also tryed beta = p ** 0.25D0
T4_p = beta
RETURN
End
Do i need to add a lib to my linker? dos anyone know what i am doing wrong.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Berry,
Put a breakpoint on the beta = line and examine what p references.
Also, look one level up the call stack and see where and whatthe function (T4_P) is pointing at.
Check for mis-typed variabes as well as undefined variables and if p references NaN, Inf etc...
Does this function have/use interfaces?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks allot Steve, when i added that lib everything works great. i was also trying stuff like this: (maybe it will help someone else)
REAL*8 FUNCTION GetPower(base,exponent)
IMPLICIT NONE
REAL*8 exponent,base
if(exponent .EQ. 0.D0) then
GetPower = 1.D0
RETURN
end if
If(base .EQ. 0.D0) then
GetPower = 0.D0
RETURN
end if
if(exponent .EQ. 2.D0) then
GetPower = base * base
RETURN
end if
GetPower = DEXP(exponent * DLOG(base))
RETURN
End
But also crashed my mex dll file.
Thx for that tip tim18, I didn't tought about that on.
the error was
??? Invalid MEX-file 'Path': The specified module could not be found.
.

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