Unique rows cell array ignored

조회 수: 2 (최근 30일)
Jim Hokanson
Jim Hokanson 2013년 5월 1일
I recently tried to find the unique rows of a cell array and got the following warning:
Warning: The 'rows' input is not supported for cell array inputs.
What was confusing to me was that this option was not supported and yet only a warning was thrown, not an error. After further examination it appears that unique is performed on all elements in the matrix, which is obviously not what I wanted.
Does this seem right? Are there other examples in Matlab where a function ignores an option and then proceeds to do something that is fundamentally different?
Thanks, Jim
  댓글 수: 1
Cedric
Cedric 2013년 5월 1일
편집: Cedric 2013년 5월 1일
I'll be interested to see what Mathworks people will answer (maybe tomorrow). If I had to place a bet, I'd say that it is for backward compatibility with a "feature" that was a bug but that might have been exploited by people.. who could therefore disable the warning and use a "silent" backward compatibility.
The doc indicates a change in the behavior of UNIQUE and the support for a 'legacy' option. Also, the version of UNIQUE called with cell args is available as an M-file
C:\Program Files\MATLAB\R2012b\toolbox\matlab\ops\@cell\unique.m
which looks quite experimental/transitional.

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

답변 (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