Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Lag funksjonen getAge(person) som returnerer alderen til personen.
Dagens dato finnes slik: [Y M D] = datevec(now);

Code Block
languagenone
get_agegetAge ( struct (' dateOfBirth ',
struct ('day ', 20, 'month ', 5, 'year ', 1990 ') )) % skal skrive ut 23
get_agegetAge ( struct (' dateOfBirth ',
struct ('day ', 15, 'month ', 12, 'year ', 1990 ') )) % skal skrive ut 22

...