Page 1 of 1

Matlab warning: Function has same name as builtin

PostPosted: Thu May 12, 2016 3:41 pm
by wer08
I have just installed Dynare 4.4.3 and wanted to run a mod-file provided by my university. When trying to run the file, Matlab shows a large number of warnings, e.g.:

Warning: Function ordeig has the same name as a MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.
> In path (line 109)
In addpath (line 88)
In dynare_config (line 48)
In dynare (line 48)


I have installed Dynare as described on dynare.org (see http://www.dynare.org/DynareWiki/InstallOnMacOSX) and run Matlab R2015b.
If any additional information is required, please let me know.

Thank you very much for your help.

Re: Matlab warning: Function has same name as builtin

PostPosted: Thu May 12, 2016 4:48 pm
by kgarb
Matlab has a built-in library of functions and other code. Giving one of your functions the same name as a built-in Matlab function could potentially confuse Matlab and cause interesting things to happen. It's the same reason why users are encouraged to use alternate spellings for greek letters - i.e. alppha instead of alpha - because these could already be defined in Matlab.

From the example you posted, it sounds like the Dynare code you've been provided has a function named "ordeig," but Matlab has already defined "ordeig" as something else, creating a conflict in interpretation.

Re: Matlab warning: Function has same name as builtin

PostPosted: Fri May 13, 2016 2:26 pm
by HoutanBastani
It seems to me that you have added the path to the dynare matlab folder by including the subfolders. This is a mistake as you have added a folder where we keep ordeig for versions of matlab/octave that do not have it. You should only add the path to the dynare matlab folder. Dynare itself will take care of including the other necessary folders in the path. In your case, it is sufficient to clear all dynare paths then type
Code: Select all
addpath /Applications/Dynare/4.4.3/matlab

Re: Matlab warning: Function has same name as builtin

PostPosted: Thu Nov 03, 2016 5:56 pm
by leolee
I have the same problem.

There was no such warning when I was using R2015. But after I installed R2016a, it started to showing such warnings.

Re: Matlab warning: Function has same name as builtin

PostPosted: Fri Nov 04, 2016 8:27 am
by jpfeifer
Did you clean your path in R2016a to only include the matlab directory of the Dynare installation?

Re: Matlab warning: Function has same name as builtin

PostPosted: Tue Nov 08, 2016 5:21 pm
by leolee
I install RS2016 to a new laptop, and then installed the dynare. So I don't think there exist any version conflict between previously installed programs.

Re: Matlab warning: Function has same name as builtin

PostPosted: Wed Nov 09, 2016 7:12 pm
by jpfeifer
@leolee: Please provide the exact and full message you get.