I have two GUI-s.
the first GUI is named: GUI1, there the user inserts three values.
then the user has a button ‘Submit’, so I want these values to be sent to other function (GUI2) every time he presses it.
my function GUI2.m gets three elements:
function GUI2(x,y,r)
.
.
.
end
and this is the first GUI:
function [E] = GUI1()
num_of_columns = 3;
E = []; % In case the user closes the GUI.
S.fh = figure('units','pixels',...
'position',[500 500 850 100],...
'menubar','none',...
'name','Number Of Columns',...
'numbertitle','off',...
'resize','off');
num = 0;
for i = 1:num_of_columns
S.ed(i) = uicontrol('style','edit',...
'units','pix',...
'position',[num 60 100 30],...
'string','');
num = num + 500/num_of_columns;
uicontrol(S.ed(1)) % Make the editbox active.
end
S.pb = uicontrol('style','pushbutton',...
'units','pix',...
'position',[290 20 180 30],...
'string','Submit',...
'callback',{@pb_call});
uiwait(S.fh) % Prevent all other processes from starting until closed.
function [] = pb_call(varargin)
% Callback for the pushbutton.
E = get(S.ed(:),'string');
E{1} = str2num(E{1});
E{2} = str2num(E{2});
E{3} = str2num(E{3});
In this line I want to send E{1}, E{2} and E{3} to GUI2
end
end
how about: