Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

choose.m 314 B

123456789101112131415161718
  1. function f = choose(flag,yes,no)
  2. % function f = choose(flag,yes,no)
  3. %
  4. % <flag> is a truth value (0 or 1)
  5. % <yes> is something
  6. % <no> is something
  7. %
  8. % if <flag>, return <yes>. otherwise, return <no>.
  9. %
  10. % example:
  11. % isequal(cellfun(@(x) choose(isempty(x),2,x),{[] 1}),[2 1])
  12. if flag
  13. f = yes;
  14. else
  15. f = no;
  16. end