Getting numbers of entries in uitable
Ältere Kommentare anzeigen
Hi guys,
I have a uitable for different entries datas, for each entry i want to count in three edit text boxes the numbers of rows wich contain different values
For each row where in the nineth column is find 'Corn'
For each row where in the nineth column is find 'Rice'
For each row where in the nineth column is find 'Flour'
I tried this but every time i change the entry with a row with different value it stops:
new_data is 1x33 3976 cell
the following is under a push button
column_name = new_data(:,9);
match_corn = strcmp(column_name,'Corn');
match_rice = strcmp(column_name,'Rice');
match_flour = strcmp(column_name,'Flour');
if match_corn == 1;
count_corn = length(match_corn);
set(handles.edit3,'String',count_corn);
end
if match_rice == 1;
count_rice = length(match_rice);
set(handles.edit4,'String',count_rice);
end
if match_flour == 1;
count_flour = length(match_flour);
set(handles.edit5,'String',count_flour);
end
could you tell me where is my mistake?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Text Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!