% neuralgraph.m % provides data for drawing a graph % % omega = inhibition constant % index = index of initial state to use % methodType = specifies which update function to use % iterations = number of iterations function finalEnergy = neuralgraph(omega,index,methodType,iterations) v = initU(index); temp = v; count = 0; while count <= iterations if count == 0 count currentEnergy = energy(omega,v); temp elseif methodType == 0 % async count currentEnergy = energy(omega, temp); temp = async(omega, temp, 1); elseif methodType == 1 % scan count currentEnergy = energy(omega, temp); temp = scan(omega, temp, 1); else error('methodType must be 0 or 1') end count = count+1; end finalEnergy = currentEnergy;