필터 지우기
필터 지우기

How to replace name with number

조회 수: 3 (최근 30일)
Light.16
Light.16 2016년 10월 6일
댓글: Guillaume 2016년 10월 6일
Hello guys !!
I've a question for you. I got a cell array like that x = {'white' 'red' 'blue' 'yellow'}. My intention is to replace my cell array with a number vector, so that white become 1, red become 2.. and so on. How can i do that?
ty

답변 (1개)

Thorsten
Thorsten 2016년 10월 6일
[~, ~, xnum] = unique(x, 'stable')
  댓글 수: 3
Light.16
Light.16 2016년 10월 6일
which tipe of function is that? IT WORKS!!! :D but how did you do that =???
Guillaume
Guillaume 2016년 10월 6일
In matlab type
doc unique
to read its documentation

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by