필터 지우기
필터 지우기

GUI produces plot in a separate window

조회 수: 9 (최근 30일)
ahmed lamak
ahmed lamak 2016년 8월 30일
댓글: ahmed lamak 2016년 8월 30일
I am extremely new to creating a GUI. I have a GUI which produces a plot on a separate window.
I have created a function in a script which takes a recurrence relation on loop to produce an output. using this output i have the following lines in my code
figure(1);
plot(real(eig(T)),'r*') ;
xlabel('x');
ylabel('y');
t1 = [ 'Display of Eigenvalues n=' num2str(n) ];
title(t1);
In my GUI script i have the following;
function solve_Callback(hObject, eventdata, handles)
% hObject handle to solve (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a = str2num(get(handles.input1_editText,'String'));
b = str2num(get(handles.input2_editText,'String'));
n = str2num(get(handles.input4_editText,'String'));
d = str2num(get(handles.input5_editText,'String'));
e = str2num(get(handles.input6_editText,'String'));
w = str2func(get(handles.input3_editText,'String'));
method(a,b,n,d,e,w);
c=toc
set(handles.Time,'String',c);
guidata(hObject, handles);
This is just the push button output of my GUI.
This produces a figure output based on the function which is called method, but it creates a figure in a separate window, i have tried for several hours however cant figure out how to get this same output inside my GUI in the axies part.
Thank you

채택된 답변

Ixxat
Ixxat 2016년 8월 30일
delete the line figure(1); figure(1) - This is forcing Matlab to plot your output a pop up window.
  댓글 수: 1
ahmed lamak
ahmed lamak 2016년 8월 30일
OMG thank you so much, i've spent hours trying to figure this out!!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by