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!