フィルターのクリア

Match the entries ?

1 回表示 (過去 30 日間)
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan 2022 年 11 月 19 日
回答済み: dpb 2022 年 11 月 19 日
Hello,
I want to match the entries in a cell and a double. The cell contains the name and the double contains the number. Kindly have a look into it. Many thanks !

採用された回答

dpb
dpb 2022 年 11 月 19 日
Look at categorical for your name variable and then either use "==" or the string matching functions such as matches for multiple locations...in isolation it's hard to know exactly what the use case is, but
tM=array2table(match,'NewVariableNames',{'Name','Value'}); % turn it into a table
tM.Name=categorical(tM.Name); % and categorical name variable
namesFind={'NameOne','NameTwo'}; % set a group of names to find somehow
ix=matches(tM.Name,namesFind); % the indices of the matches
tM.Value(ix) % display the Values of those rows in table...
tM(ix,:) % the whole table of those rows...
Obviously the general ideas can be modified as needed to match the specific desires wanted...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by