Prev: decompose strain tensor
Next: Plotting using loops
From: Matt Fig on 5 Aug 2010 09:54 "Anthony Hopf" <anthony.hopf(a)gmail.com> wrote in message <i3ecl3$hu6$1(a)fred.mathworks.com>... > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i3d9dp$j6h$1(a)fred.mathworks.com>... > > Do you need the find here at all? Why not just use logical indexing? > > > > A(A>0) = 45 > > Matt, this is essentially what "find" does right? No. IDX = A>0; creates a logical array and is much faster than doing: IDX = find(A>0); If all you need at the end is a logical array, it would be faster and easier to read if you work directly with the component logical arrays all the way through. |