Is function Unique described correctly in the documentation

조회 수: 5 (최근 30일)
Min
Min 2013년 8월 27일
I ran a example of Unique given in the online 2013a documentations
A = [9 2 9 5]; [C, ia, ic] = unique(A)
The results given in the documentation is as follows: C =
2 5 9
ia =
2
4
1
ic =
3
1
3
2
But i got the different results for ia from my Matlab 2011a as follows ia =
2 4 3
Is the description in the documentation is correct or is it a bug in the code?

채택된 답변

the cyclist
the cyclist 2013년 8월 27일
편집: the cyclist 2013년 8월 27일
There were changes in the methodology between those two versions of MATLAB. The 2013a documentation will definitely not accurately describe the 2011a behavior.
Type
doc unique
in your version to see the appropriate documentation for that version.
  댓글 수: 1
Min
Min 2013년 8월 27일
Thanks. The default in 2011a is 'last'. I should use 'first'.

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

추가 답변 (1개)

Shashank Prasanna
Shashank Prasanna 2013년 8월 27일
There are compatibility considerations for the UNIQUE function detailed here in the release notes:
Please make sure you read the relevant version's documentation as the cyclist mentioned.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by