I am working with the finacial tooldbox that has a type called FINTS, If I copy some code out of its toolbox directory to customize it, when I try do do something like fts.data, I get The specified field, 'data', does not exist in the object.
But the same thing works fine in the matlab library directory. They are both in my path, so what else do I need to change?
Thanks.
views:
33answers:
3Make sure the path is specified from the root directory, and not relative.
For instance
addpath 'c:\...\...\MATLAB\mytoolbox
not
addpath 'mytoolbox'
the latter will break if you change your working directory
I think, but I haven't checked the docs on this one, that it is a peculiarity of Matlab that the class FINTS must be defined in the directory @fints. So if you want to extend the class you have to put your code into that directory. And if you want to work on a class MYFINTS, you need to put the code into directory @myfints.
Ok I figured it out. Matlab defines class methods in what it calls method directories which are named after the class. So in this case the class is fints, so all its methods are in @fints. All I had to do was make a new directory in my own workspace called @fints, and it will become another class method of fints. You can see all the methods a class has by calling what className