Clear Filters
Clear Filters

Error with function duplicate name where there is only one function.

1 view (last 30 days)
Matlab tries to call a function with the name "SegmentBone" as you can see from the example but I get the error of duplicate name and that Matlab cannot define it. There is only one SegmentBone.m in the folder. Why duplicate name?
Error: File: SegmentBone.m Line: 7 Column: 18
Function with duplicate name "SegmentBone" cannot be defined.
Error in Test1 (line 38)
imSeg = SegmentBone(im, 10e6, 0.031);
Stelios Fanourakis
Stelios Fanourakis on 18 Jun 2019
I use the line
mex SegmentBone.cpp
This should do the compiling from cpp to Mex. However, I get the error
mex SegmentBoneDP.cpp
Building with 'Xcode Clang++'.
Error using mex
/Users/steliosphanourakes/Desktop/Matlab/DesMoines/karadokei -
Copy/FANOURAKIS_STELIOS12/20190516144930/SegmentBoneDP.cpp:17:17: error: assigning to 'const int *' from
incompatible type 'const mwSize *' (aka 'const unsigned long *')
DimsBness = mxGetDimensions(prhs[0]);
/Applications/ note: expanded from macro 'mxGetDimensions'
#define mxGetDimensions mxGetDimensions_730
/Users/steliosphanourakes/Desktop/Matlab/DesMoines/karadokei -
Copy/FANOURAKIS_STELIOS12/20190516144930/SegmentBoneDP.cpp:30:15: error: no matching function for call to
plhs[0] = mxCreateNumericArray(2,DimsBness,mxDOUBLE_CLASS,mxREAL);
/Applications/ note: expanded from macro 'mxCreateNumericArray'
#define mxCreateNumericArray mxCreateNumericArray_730
/Applications/ note: candidate function not viable: no known
conversion from 'const int *' to 'const mwSize *' (aka 'const unsigned long *') for 2nd argument
mxCreateNumericArray(mwSize ndim, const mwSize *dims, mxClassID classid, mxComplexity flag);
/Applications/ note: expanded from macro 'mxCreateNumericArray'
#define mxCreateNumericArray mxCreateNumericArray_730
2 errors generated.
Anyone who can responsibly help me?
Walter Roberson
Walter Roberson on 18 Jun 2019
You duplicated that into another question. The volunteers are not fond of answering the same query in three different Questions.

Sign in to comment.

Answers (0)


Find more on Data Import and Export in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!