help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional Statements for specific elements in Arrays and Matrixes


From: JokerOne
Subject: Re: Conditional Statements for specific elements in Arrays and Matrixes
Date: Fri, 10 Oct 2014 02:39:38 -0700 (PDT)

Or, to be more precise, is this, what you are looking for:?
>>> M=[2, 9; 5, 1]
M =

   2   9
   5   1

>>> M_tmp = M.*5
M_tmp =

   10   45
   25    5

>>> [a] = find(M <= 4)
a =

   1
   4

>>> M_tmp(a) = 4
M_tmp =

    4   45
   25    4

>>> M = M_tmp
M =

    4   45
   25    4

>>>



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Conditional-Statements-for-specific-elements-in-Arrays-and-Matrixes-tp4666918p4666920.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]