percentage_consumo= Preos2013S1(:,6)/maxconsumo; percentage_precos= Preos2013S1(:,21)/maxpreco; b = cellfun(@(x)str2double(x), teste1); b2=b; for k=2:length(teste1) if b(k)~= 0 percentage_consumo(k,:) = []; percentage_precos(k,:) = []; b2(k)=[]; end end i=0; for k=2:length(Preos2013S1(:,6)) if b(k)~=0 i=i+1; end end
All this arrays of doubles have the same size (6266×1). Besides the error that I don't understand, b2 still has a lot of rows with numbers that are not 0. And since i=2447, b2 should be 3819×1; however, its 4503×1. Can somebody please help me?
Best Answer