Versions Compared

Key

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

...

Code Block
titleoppgave_4.m
1 + 1
true + true
0 + 0
false + false

x = 1:5
x([true, true, true, true, true])
x([1, 1, 1, 1, 1])
x([false, false, false, false, false])
x([0, 0, 0, 0, 0])

Videoforklaring (7:53)

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

Svar

Expand
titleHvis du har prøvd selv, trykk her for å se svaret...
Code Block
ans =
     2
ans =
     2
ans =
     0
ans =
     0
x =
     1     2     3     4     5
ans =
     1     2     3     4     5
ans =
     1     1     1     1     1
ans =
   Empty matrix: 1-by-0
Subscript indices must either be real positive integers or logicals.
Error in oppgave_4 (line 10)
x([0, 0, 0, 0, 0])