I have one GUI (say G1) that calculates a certain value and displays it in an editbox.I need this value to be passed to an editbox in another GUI (say G2) on the click of a pushbutton for further calculations.Please help.

1 view (last 30 days)
I NEED 'edit3' value to be passed from G1 to...... edit1=str2num(char(get(handles.edit1,'String'))); edit2=str2num(char(get(handles.edit2,'String'))); if ~isempty(edit1) && ~isempty(edit2) edit3=asind(edit1/edit2); set(handles.edit3,'String',num2str(edit3)); end
BE PASSED TO 'edit1' in G2 for the following calculations: edit1=str2num(char(get(handles.edit1,'String'))); % edit2=str2num(char(get(handles.edit2,'String'))); % if ~isempty(edit1) && ~isempty(edit2) % edit3=(edit2/cosd(edit1)); % edit4=(sind(edit1)*edit3); % set(handles.edit3,'String',num2str(edit3)); % set(handles.edit4,'String',num2str(edit4)); % end

Answers (1)

Javier Bastante
Javier Bastante on 16 Mar 2016
My advice is to save the variable in a *.mat file, such as:
save myfile.mat varname
and to get the value you just type
load myfile.mat
and then you can delete the file in order to avoid been seen:
delete myfile.mat
Be sure aboour the path. It must be the same in both cases.
Hope it's useful. Best regards

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!