windows – Strange Function with duplicate name DoBenchmark cannot be defined as the function is defined only at one place

windows – Strange Function with duplicate name DoBenchmark cannot be defined as the function is defined only at one place

The name of the m-file must be different that that of the function if the function is inside a script file. i.e your m-filename cannot be DoStuff.m if DoStuff is not a function file. Either DoStuff.m should be a function file like this:

function [res] = DoStuff(param) % Note that there is no executable line before this
res = myFunction(param)
end

or you should rename either your function or your m-file.

Assuming you rename your m-file, you may use it like this:

addpath(./SubFolder/SubSubFolder); %SubSubFolder contains mex file defining myFunction
close all;

res = DoStuff(param); %Calling the function

function [res] = DoStuff(param)
res = myFunction(param)
end

windows – Strange Function with duplicate name DoBenchmark cannot be defined as the function is defined only at one place

Leave a Reply

Your email address will not be published.