Performing a number search in an excel with read table

2 ビュー (過去 30 日間)
Cristian Martin
Cristian Martin 2022 年 6 月 3 日
回答済み: Walter Roberson 2022 年 6 月 3 日
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

採用された回答

Walter Roberson
Walter Roberson 2022 年 6 月 3 日
FinalTable = T(strmp(T.IND, item), :);%where IND is the header of 33rd column
The result will be a table, not a cell.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by