MATLAB Answers

How to solve the duplicate function problem?

33 views (last 30 days)
pietro on 27 Nov 2017
Commented: pietro on 27 Nov 2017
Hi all,
I am running a script in Matlab 2017a where a my own function is run. Everything was running fine but lately, I get the following message:
Function with duplicate name "TransmissionLoadDataComputationN"
cannot be defined.
So, I typed:
which -all TransmissionLoadDataComputationN.m
but I get just one result. I searched for a second entry of the function through windows search and there is just one file named TransmissionLoadDataComputationN.m. I have even searched for all the .m files which contains the string: TransmissionLoadDataComputationN and it resulted only two .m files containing this string (the function file and the script file). So, I am pretty sure, there is no duplicate of the function. I have also tried to change the name of the function, restart Matlab and windows, to move the script and the function in another folder but nothing changed.
What should I do to solve the issue?


Fangjun Jiang
Fangjun Jiang on 27 Nov 2017
The length of 'TransmissionLoadDataComputationN' is 32, although namelengthmax should be 63 in R2017a.
Does the error message point to which line of your script caused the problem?
Matt J
Matt J on 27 Nov 2017
Show us the files so we can see how the problematic name is used.
pietro on 27 Nov 2017
@Fangjun Jiang. The error points to the line of the function declaration.
I have found a previous versione and I discovered the reason. By mistake, I typed an 'f' in the function heading lines.
I do not understand why matlab returned thaterror.
Thanks to all

Sign in to comment.

Answers (0)

Sign in to answer this question.