MATLAB: New lines from an edit text component

cell arrayedit textguiguide

Hi,
I am building a small gui using GUIDE and have a multiline edit text box. I would like to consider each line seperately. Is it possible to obtain the string in the edit box as a cell array with an element for each line?

Best Answer

Assuming h is the handle to your uicontrol ...
s = get(h, 'string');
scell = mat2cell(s, ones(size(s, 1), 1), size(s, 2));