check 2 same numbers in a matrix

조회 수: 3 (최근 30일)
Pas182
Pas182 2022년 6월 14일
댓글: Pas182 2022년 6월 14일
Hello everyone! :)
in a matrix like:
NaDFIR_from_tool = [ 80 39 101 39 101 175 237 172 232 168 232 168 104 40 ]
how can i check that a number (in this case 39 and 168) is present 2 times?
Thank you so much!
  댓글 수: 1
Pas182
Pas182 2022년 6월 14일
Awesome! thank you so much!

댓글을 달려면 로그인하십시오.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2022년 6월 14일
y= [80 39 101 39 101 175 237 172 232 168 232 168 104 40]
y = 1×14
80 39 101 39 101 175 237 172 232 168 232 168 104 40
nnz(y==39)==2
ans = logical
1
nnz(y==168)==2
ans = logical
1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by