Performing a number search in an excel with read table
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Cristian Martin
am 3 Jun. 2022
Beantwortet: Walter Roberson
am 3 Jun. 2022
I have this script where input of edit8 is a number and the column IND is : 41x1 1812 table
T = readtable('BD\prices.xlsx');%read excel
item = (get(handles.edit8,'String'));%get the number from user
FinalTable = T(T.IND == item,:);%where IND is the header of 33rd column
data = cell2table(FinalTable);%converting to table
set(handles.uitable1, 'Data', data);%display in uitable allrowsthat contain in IND column number in item
and the error:
Error using ==
Matrix dimensions must agree.
Error in Generator_v10>pushbutton19_Callback (line 816)
FinalTable = T(T.IND == item,:);%where IND is the header of 33rd column
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Jun. 2022
FinalTable = T(strmp(T.IND, item), :);%where IND is the header of 33rd column
The result will be a table, not a cell.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!