annotate sched/list_schedule.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents f7fb679637ff
children
rev   line source
samer@10 1 % list_action - Make event action from list of times and parameters
samer@10 2 %
samer@10 3 % list_action ::
samer@10 4 % timed_action({A},{}) ~'the action to perform at each time',
samer@10 5 % seq cell {
samer@10 6 % time ~'time of event',
samer@10 7 % A ~'argument to pass to action'
samer@10 8 % } ~'the list of times and parameters to action'
samer@10 9 % -> time ~'time of first event',
samer@10 10 % msched_action.
samer@10 11
samer@10 12 function sch=list_schedule(action,X)
samer@10 13 if isempty(X), sch={};
samer@10 14 else e0=head(X); sch={e0{1},@act}; end
samer@10 15
samer@10 16 function [err,sch1]=act(t_sched)
samer@10 17 err=action(t_sched,e0{2});
samer@10 18 sch1=list_schedule(action,next(X));
samer@10 19 end
samer@10 20 end