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 次查看(过去 30 天)
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

回答(1 个)

Javier Bastante
Javier Bastante 2016-3-16
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

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by