I’m trying to write a program which computes the variable called P for a set of numbers (i=1:10), except for one number (ind), which is chosen each time.
The first time P is calculated for i=1:10 and for example the number 4 is chosen as ind and used and we don’t want it to be included in the next iteration. So this next iteration P has to be calculated for i=[1:3 5:10].
How can i handle this? What I have this far is:
for i=1:10
i=1:i
t = sum(Job(i,2))
i=1:10
P = mean(Job(i,2))
Index= Job(i,4)/Job(i,2)*exp(-max(Job(i,1)-Job(i,2)-t,0)/2*P)
X=max(Index)
ind=find(Index >= X)
completion_time(Job(ind,3))= machine_free_time + Job(ind,2)
machine_free_time = completion_time(Job(ind,3))
Lateness(Job(ind,3))= completion_time(Job(ind,3)) - Job(ind,1)
Tardiness(Job(ind,3))= max(Lateness(Job(ind,3)),0)
end
Two ways of doing this:
Remove elements from a vector
Use a 2nd vector to keep hold of which values are already used:
So for example to use this 2nd method with the thing you’re trying to do, I think it’ll go like this: