MATLAB: Store text in array as string from GUI text box

string array store push button

On the first screen of my GUIDE-made GUI I want the participant to enter their name in the text-box and press the OK push button. Once they press the button, the name should be stored in the 1st column, 2nd row of an array for the participant's data in the form of a string. How may I do this?
N.B. Prior to the opening of this GUI, I already have an array for the participant's data created with multiple columns and 2 rows, where the first row is filled (header), and the 2nd rows are empty (to be filled with participant data).
Help would be much appreciated.

Best Answer

What is your array? Is it a cell array, or a table? Let's say it's a cell array, then just get the edit field and assign it to whatever column you want
editString = get(handles.edit1, 'String');
ca{2, columnNumber} = editString;
Or if it's a table
rowToChange = 2; % Whatever....
% Change value in row 2 of column called "Col8". t is the table variable.
t.Col8{rowToChange} = editString;