Matlab Gui builder...
Matlab Gui builder...
(OP)
I'm new to the GUI builder with the Matlab environment...
The question is very simple, as an examples...
If i use two edit text boxes to enter 2 variables...and a push button to execute a multiplication...
How do i display the result either in a edit text box or in a list box or any other way that will display a result on screen...
Quick reply would be appreciated...thanks
The question is very simple, as an examples...
If i use two edit text boxes to enter 2 variables...and a push button to execute a multiplication...
How do i display the result either in a edit text box or in a list box or any other way that will display a result on screen...
Quick reply would be appreciated...thanks





RE: Matlab Gui builder...
It is very easy in the newer versions of Matlab. When you activate the GUI just answer YES to save the figure. The editor/debuger window will be opened with a prototype file. Down you will find headers for callbacks. Suppose you create 2 edit boxes , one text box (for the result) and a button. You have to fill in only acallback for the button. Under the header:
function varargout = pushbutton1_Callback(h, eventdata, handles, varargin)
Put the following lines:
A=get(handles.edit1,'string');
B=get(handles.edit2,'string');
if ~isempty(A) & ~isempty(B)
C=num2str(str2num(A{:})*str2num(B{:}));
else
C='?';
end
set(handles.text1,'string',C)
Save the file, thats it.
Joe
BSTEX - Equation viewer for Matlab
http://www.geocities.com/bstex2001
RE: Matlab Gui builder...
But what if i want to display the result say...in an edit text box so that the user can see the result?
RE: Matlab Gui builder...