Logical indexing in categorical array

7 ビュー (過去 30 日間)
Deepayan Bhadra
Deepayan Bhadra 2020 年 8 月 18 日
コメント済み: Deepayan Bhadra 2020 年 8 月 20 日
I want to ask about the logical indexing at the end. This is from Mathworks website. Looking at B(TF), it doesn't seem to convey anything meaningful. What am I missing?
  5 件のコメント
Steven Lord
Steven Lord 2020 年 8 月 20 日
You're using an older release of MATLAB. Using a cell array of char vectors rather than a string array:
rng default % So we generate the same A each time
A = randi(3, [3 3])
B = categorical(A, 1:3, {'red'; 'green'; 'blue'})
TF = B ~= 'red'
nonred = B(TF)
Deepayan Bhadra
Deepayan Bhadra 2020 年 8 月 20 日
I got it now :)

サインインしてコメントする。

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by