How to access tools function

5 views (last 30 days)
tomas
tomas on 4 Sep 2012
Hello everybody,
is it possible to get access to individual tools function. I need to get some information about Data Cursor tool and also modify it little bit.
Thankx for your help,
Tom

Answers (2)

Jan
Jan on 4 Sep 2012
Edited: Jan on 4 Sep 2012
You can find out, if the function is implemented as M-file, such that you can modify a copy of it:
profile on
% Now perform the actions using the buttons or menus
profile report
Now you find information about the used functions and can set breakpoints for a deeper inspection during you use the tool the next time.
[EDITED] I assume creating a new data cursor tool matching your needs is more efficient than changing the original function. Did you look in the FileExchange, if somebody did this already?

Walter Roberson
Walter Roberson on 4 Sep 2012
Tracing the data cursor tool is tricky because the object that you click on in the menu area, has had its callback set to be a method of an object, and not a static function.
I usually find it easiest to use the documentation in datacursormode to set an UpdateFcn to my own routine, and set a breakpoint in that routine, and then to trace back from there when the breakpoint is hit. You get deep into some undocumented object class definitions whose few comments assume that you have a design document available to you but which in fact is only available to Mathworks staff.
If you are unable to do your changes just by setting an UpdateFcn then you are likely to get lost in the internal code very quickly. It is not intended to be altered or understood by users.

Products

Community Treasure Hunt

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

Start Hunting!