HI, is there any built in function in MATLAB to check, if all the elements in cell array or double array are same or not

조회 수: 6 (최근 30일)
Is there any built in function in MATLAB to check, if all the elements in cell array or double array are same or not, for example, if same then do some calculations else do something else
fck1 = {3,3,3,3,3}
% return 1 or 0 for uniqueness
if fck1% unique
%calculation
else
%calculations
end

채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 5월 14일
something like this
flag=numel(unique([fck1{:}]))==1

추가 답변 (0개)

카테고리

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