set zero to multiple values in a matrix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

set zero to multiple values in a matrix

BOKU
Hello,

i would like to know if there is a fast way to select some items of a
indexed matrix?

this is not working in my case ?!

sel =

     [14   19   23   24   25   29]

lab is a 301x301 labeled matrix

numel(unique(lab))
    ans =  47

I want to do something like

lab(lab==!sel)=0

do I really need to go through a loop for doing this?

greets chris



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave