Info

This question is closed. Reopen it to edit or answer.

How select data from a table that have the same code field?

1 view (last 30 days)
I have a excel table in which I have many columns but in the first one it is the type of data as it is shown in the image attached (A, B, C, D) and I want to program a popupmenu button in which I can select for example A and just work with all the data that has the letter A in the first column.
How can I write the code for that? I just have this code for the moment in which I make appeared no just the unique values A, B, C , D but A,A,A,A,B,B,B,B,B,B,C,C,C,.... etc. an so on.
[FileName,FilePath ]= uigetfile('*.xls');
ExPath = fullfile(FilePath, FileName);
set(handles.edit1,'string',ExPath)
Val=dataset('XLSFile',[FilePath,FileName]);
c1 = Val(:,1)
set(handles.popupmenu5,'string',dataset2cell(c1));
handles.Val = Val;
guidata(hObject, handles)
Thanks in advanced

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!