Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Hva skrives ut hvis vi kjører det følgende scriptet?

Code Block
titleoppgave_3.m
x = 1:5
x([true,false, true, false, true])
x(true)
x > 3
x(ans)
mod(x,2)
mod(x,2) == 0
x < 2 | x >= 4 & mod(x, 2) == 0
x(x < 2 | x >= 4 & mod(x, 2) == 0)

Videoforklaring (14:44)

Widget Connector
urlhttps://www.youtube.com/watch?v=j7YPR5CcpsY

Svar

Expand
titleHvis du har prøvd selv, trykk her for å se svaret...
Code Block
x =
     1     2     3     4     5
ans =
     1     3     5
ans =
     1
ans =
     0     0     0     1     1
ans =
     4     5
ans =
     1     0     1     0     1
ans =
     0     1     0     1     0
ans =
     1     0     0     1     0
ans =
     1     4