sql - Why does my text value not appear in matlab gui? -
i've managed retrieve 5 string values database whereby results = 'something1' 'something2' 'something3' 'something4' 'something5'. want these values display in edit texts matlab gui. how do that? how pass values results = curs.data; 5 different set(handles.edit1,'string');?
%assign data output variable results = curs.data; display(results); %diplay in edit texts matlab gui set(handles.edit1,'string'); set(handles.edit2,'string'); set(handles.edit3,'string'); set(handles.edit4,'string'); set(handles.edit5,'string');
if results
cell array do:
set(handles.edit1,'string',results{1});
and repeat each string. or, if wish, can use arrayfun
:
arrayfun(@(k) eval(['set(handles.edit' num2str(k) ',''string'',results{' num2str(k) '}); ']),1:5);
Comments
Post a Comment