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

7 次查看(过去 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