Info
此问题已关闭。 请重新打开它进行编辑或回答。
Modifying Axes properties from different file than the one it was created in
1 次查看(过去 30 天)
显示 更早的评论
I am working with a simple GUI that has some axes and a push button. Now when the push button is pressed it calls another m file and executes a function, and the results are plotted in figure on the axes. Now what I am trying to do is to modify this axes after the results are plotted. I know I can do this from using set(handles.axes2...., but this can only be used inside the figure file. I want to edit the axes's properties with code in the function file, not the figure file. In more specific terms, I want the syntax to access the axes's handle from outside the file it was created in, (i.e. from the function that performs the calculation)
Thanks
0 个评论
回答(1 个)
Walter Roberson
2012-5-25
The set() can be done within any function that can find the appropriate handle. This could be by way of passing in the handles structure, or by way of passing in information (such as the figure handle) that allows the handles structure to be retrieved via guidata(), or by way of having the function findobj() the handle using information such as its Tag.
For example if you were using GUIDE, then any of the callbacks that are created with the hObject, event, and handles parameters, could be moved to individual .m files [you would run into difficulties with GUIDE's automatic renaming of functions as needed when the object names change, but MATLAB would be fine to have them in separate .m files]
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!