-
1 Comment
Saad
on 27 Apr 2020
Could you check this for me, please?
[ra,ca]=size(a);
if ra>ca
a=a';
end
j=1;
V=[a(1,1);1];
for i=2:size(a,2)
X=a(1,i);
if V(1,j)==X
V(2,j)=V(2,j)+1;
else
j=j+1;
V(1,j)=X;
V(2,j)=V(2,j)+1;
end
end
val=V(V(2,:)==max(V(2,:)))
if ra>ca
val=val';
end
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!