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

2 visualizzazioni (ultimi 30 giorni)
Hello
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);
  9 Commenti
Stelios Fanourakis
Stelios Fanourakis il 18 Giu 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/MATLAB_R2018b.app/extern/include/matrix.h:243:25: 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
'mxCreateNumericArray_730'
plhs[0] = mxCreateNumericArray(2,DimsBness,mxDOUBLE_CLASS,mxREAL);
^~~~~~~~~~~~~~~~~~~~
/Applications/MATLAB_R2018b.app/extern/include/matrix.h:275:30: note: expanded from macro 'mxCreateNumericArray'
#define mxCreateNumericArray mxCreateNumericArray_730
^~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1247:1: 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/MATLAB_R2018b.app/extern/include/matrix.h:275:30: note: expanded from macro 'mxCreateNumericArray'
#define mxCreateNumericArray mxCreateNumericArray_730
^
2 errors generated.
Anyone who can responsibly help me?
Thanks
Walter Roberson
Walter Roberson il 18 Giu 2019
You duplicated that into another question. The volunteers are not fond of answering the same query in three different Questions.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Data Import and Export in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by