필터 지우기
필터 지우기

Find in Array of Strings

조회 수: 1 (최근 30일)
Sam Da
Sam Da 2011년 6월 28일
how do i find the row number for 'STG' in the following array of names as: 'asf' 'poif' 'STG' 'iam' 'no'

채택된 답변

Matt Fig
Matt Fig 2011년 6월 28일
Is your array a cell array or a character array? If it is a cell array,
A = {'asf'
'poif'
'STG'
'iam'
'no'}
strmatch('STG',A)
Or you can use:
find(strcmp(A,'STG'))
  댓글 수: 1
Jan
Jan 2011년 6월 28일
I prefer the faster STRCMP method. +1

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by