How to populate matlab GUI edit texts with values from MySQL database? -
i have created table 10 columns in matlab database toolbox. how retrieve values , show them in matlab gui? when use code below, undefined function 'fetch' input arguments of type 'double' error. can tell me wrong code?
f = getappdata(0,'fvalue'); %set preferences setdbprefs. setdbprefs('datareturnformat', 'cellarray'); setdbprefs('nullstringread', 'null'); %make connection database. conn = database('marine_invertebrates', '', ''); %read data database. curs = fetch(conn, sprintf(['select description.commonname'... ' , description.scientificname'... ' , description.kingdom'... ' , description.phylum'... ' , description.subphylum'... ' , description.class'... ' , description.order'... ' , description.family'... ' , description.genus'... ' , description.species'... ' marine_cbir.description description.imageid = "%s"'], num2str(f))); curs = fetch(curs); close(curs); %assign data output variable results = curs.data; commonname = set(handles.edit11,'string'); display (commonname); scientificname = set(handles.edit1,'string'); display (scientificname); kingdom = set(handles.edit2,'string'); display (kingdom); phylum = set(handles.edit3,'string'); display (phylum); subphylum = set(handles.edit4,'string'); display (subphylum); class = set(handles.edit5,'string'); display (class); order = set(handles.edit6,'string'); display (order); family = set(handles.edit7,'string'); display (family ); genus = set(handles.edit8,'string'); display (genus); species = set(handles.edit9,'string'); display (species );
Comments
Post a Comment