Here is a simple one-liner:
hsvSecond(repmat(hsvSecond(:,:,2) > 0.35, [1,1,3])) = 0;
or this possibly more efficient alternative (although some rudimentary test suggest otherwise which does surprise me):
hsvSecond = bsxfun(@times, hsvSecond(:,:,2) <= 0.35, hsvSecond)
Some comments on your code though:
width=length(hsvSecond(:,1,1));
height=length(hsvSecond(1,:,1));
Should be
width = size(hsvSecond,1)
height = size(hsvSecond,2)
and
hsvSecond(i,j,1)=0;
hsvSecond(i,j,2)=0;
hsvSecond(i,j,3)=0;
could have been
hsvSecond(i,j,:)=0;