how can i plot in the axes of other gui??????

조회 수: 2 (최근 30일)
ali hadjer
ali hadjer 2015년 11월 13일
댓글: Walter Roberson 2015년 11월 15일
hello; i have two gui with buttons and axe i want to plot in the second axe *of the *second gui by cliking int the button on the first gui with the informations in the first gui how can i do ?????

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 14일
findobj() the Tag for the second axes to get its handle. Then use that handle in your plotting calls, either by passing it as the first parameter to the plotting routines (supported by many plotting routines) or by using the axes as the 'Parent' property for plotting routines that allow you to pass Name/Value pairs. For example,
TheOtherAxes = findobj('Tag', 'Gui2axes');
plot(TheOtherAxes, rand(1,20));
  댓글 수: 4
ali hadjer
ali hadjer 2015년 11월 14일
??? Undefined function or method 'ne' for input arguments of type 'cell'.
Error in ==> technique_optimisation>pushbutton6_Callback at 460 possible_axes = possible_axes(axes_figures ~= current_figure);
Error in ==> gui_mainfcn at 98 feval(varargin{:});
Error in ==> technique_optimisation at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)technique_optimisation('pushbutton6_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Walter Roberson
Walter Roberson 2015년 11월 15일
possible_axes = findobj('Tag', 'axes1');
axes_figures = ancestor(possible_axes, 'figure');
if iscell(axes_figures); axes_figures = cell2mat(axes_figures); end
current_figure = ancestor(gcf, 'figure');
possible_axes = possible_axes(axes_figures ~= current_figure);
if length(possible_axes) ~= 1
error('Could not find unique axes1 belonging to another GUI');
end
TheOtherAxes = possible_axes;
plot(TheOtherAxes, rand(1,20)); %plot on it

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by