MATLAB: Time dependent programs

looptime

is there such a method or a way i can write a program that would loop for a certain TIME instead of a certain number. for example if i want to run a program that would loop for 12 hours then stop…is this possible? thanks cheers SN

Best Answer

iniTime = clock;
limit = 12 * 3600; % Seconds
while etime(clock, iniTime) < limit
% do the processing here
end
Related Question