help-octave
[Top][All Lists]
Advanced

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

Re: multi-dimensional logical index assignment?


From: Nicholas Jankowski
Subject: Re: multi-dimensional logical index assignment?
Date: Mon, 4 May 2020 16:13:43 -0400



It is possible in a one-liner -- you just have to expand the logical
indices:
a((a(:,:,4)>.5)&shiftdim(1:size(a,3)==2,-1))=0

wow.  you definitely win code golf on this one. that's not an approach I had thought of. 

reply via email to

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