Filter löschen
Filter löschen

How do we accept values and store them in a column array in a gui component like an edit box?

2 Ansichten (letzte 30 Tage)
I have a gui and would like to accept various values from user and store them in a column array..For eg. if the values he enters are 6,4,7,3,8 my gui has to store them in an array like A=[6;4;7;3;8].
Please suggest a sample code if possible..Thanks.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 21 Aug. 2012
use an "Edit text" object
set(handles.EdittextName,'String','[0 0 0 0]')
a user has just to fill the Edit text object with desired values
to get these data use
A = str2num(get(handles.edit2,'String'));
  3 Kommentare
Nitin Samuel
Nitin Samuel am 21 Aug. 2012
Bearbeitet: Nitin Samuel am 21 Aug. 2012
how does this code account for a variable sized array? coz the size of my array differs according to the number of inputs the user gives..
Ken
Ken am 20 Sep. 2012
If you simply have [] around whatever you want the text to say it should work regardless of the size of the array.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by