When I run the following solution for Test Suite #1, I get a zero in my solution array. If I replace c(i) with c, I get back a 2 and 3 (no zero). What is going on that a zero shows up? [count, val] = histcounts(categorical(vect)) val = cellfun(@str2double, val) % convert val from string to numerical for i = 1:length(count) if count(i) == 3 c(i) = val(i) end end
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.