I'm trying to select a value from one column in a cell array based on another value.

2 ビュー (過去 30 日間)
benjamin powers
benjamin powers 2018 年 10 月 16 日
回答済み: OCDER 2018 年 10 月 16 日
I imported an excel table in to matlab as a cell array and want. I have two columns three columns of interest; System ID, Sampling Frequency, and DOH Priority. I want to identify and System ID's that have a DOH priority of 'ND'. From here I want to make another cell array or table with all the System ID's and Sampling frequencies. I've had some success using strfind but it's just giving me my original table with 1's and 0's for the sites. Am I approaching this the right way or is there a better way to do this? Thanks!

採用された回答

OCDER
OCDER 2018 年 10 月 16 日
Table = {1 23 'ND';
2 33 'ND';
3 14 'AA';
4 11 'AA';
6 16 'ND'}; %Your table, SystemID (col-1), Frequency (col-2), DOH (col-3);
NDLoc = strcmpi(Table(:, 3), 'ND'); %Logical index of ND columns
NDTable = Table(NDLoc, 1:2); %SystemID and Frequency of ND priority only

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by