myfind.m 388 B

123456789101112131415161718192021
  1. function Eind=myfind(EVENTS,Ename)
  2. Eind=[];
  3. if isfield(EVENTS{1},'name')
  4. for k=1:length(EVENTS)
  5. if strcmpi(EVENTS{k}.name,Ename)
  6. Eind=[Eind,k];
  7. end
  8. end
  9. elseif iscell(EVENTS)
  10. for k=1:length(EVENTS)
  11. if strcmpi(EVENTS{k},Ename)
  12. Eind=[Eind,k];
  13. end
  14. end
  15. end
  16. end