How to display 7 digit numbers in matlab list box -
i have been tasked fix bug in matlab program written other people , have issue displaying 7 digit serial numbers in list box. number database , numbers pulled instead of example having serial number 4800801 displayed in listbox control, displayed in scientific notation.
here code
statement = 'select product_serial_number master_product status = 109 order product_serial_number asc'; curs = exec(conn, statement); curs = fetch(curs); if strcmp(curs.data,'no data') == 0 handles.matrix(1:length(cell2mat(curs.data)),1) = cell2mat(curs.data); end handles.basepre2data = curs.data; set(handles.listbaseprebuild2,'string',handles.basepre2data); r = cellfun(@isnumeric, curs.data); if mean(r) == 1 set(handles.textboxbaseprebuild2total,'string',num2str(length(handles.basepre2data))); else set(handles.textboxbaseprebuild2total,'string','0'); handles.basepre2data = []; end
i new matlab not sure how format output 7 digit numbers.
i figured out,i had use cellfun , change format num2str
set(handles.listbaseprebuild2,'string',cellfun(@num2str,handles.basepre2data,'uniformoutput',false));
Comments
Post a Comment