Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: mxGetNumberOfDimensions missing ?
Replies: 15   Last Post: Nov 24, 2009 1:08 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Madhusudan Singh

Posts: 130
Registered: 1/25/05
mxGetNumberOfDimensions missing ?
Posted: Oct 21, 2009 3:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Mac OSX 10.5.6
Matlab R2009a

gfortran/gcc

Code fragment:

subroutine mexFunction(nlhs, plhs, nrhs, prhs)
use matlabmex

implicit none

integer, intent(in) :: nlhs, nrhs
integer, intent(in), dimension(:), pointer :: prhs
integer, intent(out), dimension(:), pointer :: plhs

integer(i4b) :: l,m,n
integer(i4b), pointer :: n1
integer(i4b), pointer :: A

if(nrhs /= 2) then
call mexErrMsgTxt('Function requires four input arguments.');
end if

A = mxGetData(prhs(1))
n1 = mxGetDimensions(prhs(1))

end subroutine mexFunction


matlabmex.f90 contains:

integer (kind=4) function mxGetData(pm)
use constants
integer (kind=4) :: pm
end function mxGetData

integer (kind=4) function mxGetDimensions(pm)
use constants
integer (kind=4) :: pm
end function mxGetDimensions

integer(kind=4) function mxGetNumberOfDimensions(pm)
use constants
integer(kind=4) :: pm
end function mxGetNumberOfDimensions

in the interface block.

Compilation:

/Applications/MATLAB2009a/MATLAB_R2009a.app/bin/mex -maci mexFunction.f90
Undefined symbols:
"_mxgetdimensions_", referenced from:
_mexfunction_ in mexFunction.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

mex: link of ' "mexFunction.mexmaci"' failed.

It can find mxGetData() but not mxGetNumberOfDimensions()

I have checked my matlab documentation to confirm that the function exists.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2009. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Goodwin College of Professional Studies.