1
I created the vector fragil that will accept various inputs from the user, inputs that will (or will not) be the position of other elements in another matrix. I used the following function to create the vector fragil:
fragil = zeros(1, numIdosos);
And then I wanted to check on the second if of the excerpt below if the j belongs to the vector fragil. I mean, is there any way to verify that the j belongs to the vector fragil without adding the for extra that travels the vector fragil whole?
for j=1:numIdosos
if MCobertura(iMax,j)==1
contador(j)=contador(j)+1;
end
if contador (j)>1
porCobrir(j)=0;
end
end
n_porCobrir=sum(porCobrir);
end
end