Pastebin

Paste #1299: octave

< previous paste - next paste>

Pasted by tdn

Download View as text

A =

   0.00000   0.53484   0.29289
   1.00000   0.81844   0.67935
   1.00000   0.14699   0.38383
   0.00000   0.94356   0.84100
   0.00000   0.22505   0.50152
   1.00000   0.85073   0.73703

octave:11> idxZero=A(:,1)==0
idxZero =

   1
   0
   0
   1
   1
   0

octave:12> idxOne=A(:,1)==1
idxOne =

   0
   1
   1
   0
   0
   1

octave:13> B(idxZero)=A(idxZero,2)
error: invalid vector index = 0
error: assignment failed, or no method for `matrix = matrix'
error: evaluating assignment expression near line 13, column 11

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.