function [bits_alloc, energy_alloc] = ResolvetheLastBit(bits_alloc,energy_alloc,index,energytable,num_subc) max_val = 0; for i = 1:num_subc if (i ~= index & bits_alloc(i) == 1) if bits_alloc(i) ~= 0 temp = energytable(i,bits_alloc(i)) ; end if (temp > ma