How to access tools function

5 次查看(过去 30 天)
tomas
tomas 2012-9-4
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

回答(2 个)

Jan
Jan 2012-9-4
编辑:Jan 2012-9-4
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 2012-9-4
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.

类别

Help CenterFile Exchange 中查找有关 Software Development Tools 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by