Matlab warning: Function has same name as builtin

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Matlab warning: Function has same name as builtin

Postby wer08 » Thu May 12, 2016 3:41 pm

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.
wer08
 
Posts: 1
Joined: Thu May 12, 2016 3:28 pm

Re: Matlab warning: Function has same name as builtin

Postby kgarb » Thu May 12, 2016 4:48 pm

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.
kgarb
 
Posts: 34
Joined: Thu May 28, 2015 9:19 pm

Re: Matlab warning: Function has same name as builtin

Postby HoutanBastani » Fri May 13, 2016 2:26 pm

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
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Matlab warning: Function has same name as builtin

Postby leolee » Thu Nov 03, 2016 5:56 pm

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.
leolee
 
Posts: 30
Joined: Thu Mar 19, 2015 9:54 am

Re: Matlab warning: Function has same name as builtin

Postby jpfeifer » Fri Nov 04, 2016 8:27 am

Did you clean your path in R2016a to only include the matlab directory of the Dynare installation?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Matlab warning: Function has same name as builtin

Postby leolee » Tue Nov 08, 2016 5:21 pm

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.
leolee
 
Posts: 30
Joined: Thu Mar 19, 2015 9:54 am

Re: Matlab warning: Function has same name as builtin

Postby jpfeifer » Wed Nov 09, 2016 7:12 pm

@leolee: Please provide the exact and full message you get.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests