Software Warning Messages - Potential Name Conflict in Custom Functions

18 views (last 30 days)
I wanted to reach out to discuss a recurring issue I've been encountering when opening MATLAB. I keep getting the following warning messages:
Warning: Function iscolumn has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function ismatrix has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function isrow has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function narginchk has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function isequaln has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function istable has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function isfile has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function isfolder has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
To provide some context, I'm using MATLAB with the following toolboxes:
  1. Image Processing
  2. Optimization
  3. Signal Processing
  4. Statistics and Machine Learning
Additionally, I have spm12 and Gannet installed for my specific analysis needs.
I believe these messages are related to custom functions I have created, but I'm not entirely sure about the implications or the best course of action to address this. Therefore, I am seeking guidance from the knowledgeable members of this community.
Has anyone else encountered these warnings when using MATLAB? Could you kindly shed some light on the potential consequences of these conflicts and the best practices for resolving them? I am particularly concerned about how these name conflicts might affect the functionality of my custom functions and the built-in MATLAB functions.
I'm unsure about how to proceed and would appreciate any advice or insights from experienced users in the community. Is renaming my custom functions the only solution to avoid conflicts? If so, what naming conventions would you recommend to prevent future issues?
Thank you so much for your time and assistance.

Answers (1)

Steven Lord
Steven Lord on 7 Aug 2023
What do these commands display for you?
which -all narginchk
built-in (/MATLAB/toolbox/matlab/lang/narginchk)
which -all istable
built-in (/MATLAB/toolbox/matlab/datatypes/tabular/istable) /MATLAB/toolbox/matlab/datatypes/tabular/@table/istable.m % table method /MATLAB/toolbox/parallel/parallel/@distributed/istable.m % distributed method /MATLAB/toolbox/parallel/parallel/@codistributed/istable.m % codistributed method
Based on other messages I've seen on Answers in the past I believe that spm12 includes implementations of some built-in functions for use in releases prior to their introduction to MATLAB. If that's the case and you're using a release that has these built-in functions available, removing from the MATLAB search path the directory or directories that are part of spm12 that contains these implementations may be a solution.
  1 Comment
Jaclyn
Jaclyn on 8 Aug 2023
Hello Steven Lord,
Thank you for your guidance. I followed your advice and executed the commands you provided. Here's what I found:
For narginchk:
/Volumes/Cirago/spm12/external/fieldtrip/compat/matlablt2011b/narginchk.m
built-in (/Applications/MATLAB_R2023a.app/toolbox/matlab/lang/narginchk) % Shadowed
For istable:
/Volumes/Cirago/spm12/external/fieldtrip/compat/matlablt2013b/istable.m
built-in (/Applications/MATLAB_R2023a.app/toolbox/matlab/datatypes/tabular/istable) % Shadowed
/Applications/MATLAB_R2023a.app/toolbox/matlab/datatypes/tabular/@table/istable.m % table method
Your observation that these functions are shadowed by the spm12 implementations appears spot on. It seems like my MATLAB environment has multiple instances of these functions, leading to the name conflicts and warning messages. With your insights, I now have a clear plan of action: I'll focus on managing the directories associated with spm12 to prevent these shadowing conflicts.
Thank you once again for your invaluable assistance!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!