Filter löschen
Filter löschen

Undefined function or variable 'price2ret'

5 Ansichten (letzte 30 Tage)
Fara
Fara am 19 Jun. 2011
I have installed Matlab in a new computer and try to re-run one of my m files which call price2ret. My m file works before but now the system compliants with "Undefined function or variable 'price2ret'". I have checked my path which correctly points to the toolbox directory. Appreciate if anyone can give me a hand.

Antworten (3)

Fara
Fara am 19 Jun. 2011
Problem persists even if I follows the example in Help as: m = 100*exp(0.10*[0:19]'); R = price2ret(m);
Error message: ??? Undefined function or method 'price2ret' for input arguments of type 'double'.
I did explicitly set my current directory to the Econ toolbox that holds price2ret.m.

Walter Roberson
Walter Roberson am 19 Jun. 2011
That can happen if the new system does not have the econ toolbox installed, or if it is not licensed for the econ toolbox, or if the econ toolbox is not on the path, or if MATLAB did not notice it exists.
There is a possibility that if you use
rehash toolbox
that it might appear, but my top suspicion would be on the system not being licensed.

Fara
Fara am 20 Jun. 2011
Hi Walter,
Thanks for your help. The only thing in your list that I wouldn't be able to verified is that "Matlab didn't notice it exists". Others shouldn't be an issue. In addition, I don't know what is rehash toolbox so I assume that I don't have it. Any other thought?
  1 Kommentar
Walter Roberson
Walter Roberson am 20 Jun. 2011
"rehash toolbox" is a MATLAB command. http://www.mathworks.com/help/techdoc/ref/rehash.html
The message you are getting is exactly the message I would expect if you are not licensed to use the toolbox. For example, I am licensed to use the Image Processing toolbox but my co-worker the next office over is not named in the license; I can use the Image Processing commands but he just gets told they do not exist.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by