필터 지우기
필터 지우기

Logical indexing in categorical array

조회 수: 5 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by