samedi 20 février 2016

storing values from a matrix to another one with an if operation using matlab

I have a "x1" matrix, and I want to extract some particular elements with respect to a logical condition:

for z=1:length(x1)
  if (x1(z+1)-x1(z))>=20)
       extract=
  end
end

How can I obtain the "extract" matrix and the indices of these values in x1?

Aucun commentaire:

Enregistrer un commentaire