Azzera filtri
Azzera filtri

GUI produces plot in a separate window

9 visualizzazioni (ultimi 30 giorni)
ahmed lamak
ahmed lamak il 30 Ago 2016
Commentato: ahmed lamak il 30 Ago 2016
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

Risposta accettata

Ixxat
Ixxat il 30 Ago 2016
delete the line figure(1); figure(1) - This is forcing Matlab to plot your output a pop up window.
  1 Commento
ahmed lamak
ahmed lamak il 30 Ago 2016
OMG thank you so much, i've spent hours trying to figure this out!!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by