Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

EDIT BOX OF GUI IN MATLAB

Status
Not open for further replies.

fatimajoy

Junior Member level 3
Joined
May 25, 2007
Messages
25
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,447
hi! I have a gui with edit box and push button. what I want is when the user input his name and number, once the push button is click the entered data will be save. can anyone help me. A code will really help thanks!
 

It is der in the matlab help documentation itself.

If u cant find it, go here, On this is online documenation.
https://www.mathworks.com/access/he...10&query=gui+edit+box&submitButtonName=Search

And U have to create a callback for the event, as the whole thing is event driven,
And then u have to attach a variable to it.

--------------------This is an example---------
from here...
https://www.mathworks.com/access/he...10&query=gui+edit+box&submitButtonName=Search

is as follows:-


Retrieving Numeric Data from an Edit Text Component

MATLAB returns the value of the edit text String property as a character string. If you want users to enter numeric values, you must convert the characters to numbers. You can do this using the str2double command, which converts strings to doubles. If the user enters nonnumeric characters, str2double returns NaN.

You can use the following code in the edit text callback. It gets the value of the String property and converts it to a double. It then checks whether the converted value is NaN (isnan), indicating the user entered a nonnumeric character and displays an error dialog (errordlg).
function edittext1_Callback(hObject, eventdata, handles)
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry)
errordlg('You must enter a numeric value','Bad Input','modal')
return
end
% Proceed with callback...


========================



Just go thru the documentation, its der
Or u can visit the Mathworks.com, In the Central file exchange, der are lot of help files uploaded by users.
Just search Matlab Central
https://www.mathworks.com/matlabcentral/?s_cid=matlabcentral
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top