help-octave
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Re: find() and setting matrix elements to 1
From
:
Nir Krakauer
Subject
:
Re: find() and setting matrix elements to 1
Date
:
Tue, 8 Oct 2013 12:11:03 -0400
ind = find(C <= 0.5);
C(ind) = 1;
If you need the row and column indices, use
[i, j] = ind2sub([5, 6], ind);
Otherwise one line is enough:
C(C <= 0.5) = 1;
reply via email to
[
Prev in Thread
]
Current Thread
[
Next in Thread
]
find() and setting matrix elements to 1
,
Victor Semanic
,
2013/10/08
Re: find() and setting matrix elements to 1
,
Nir Krakauer
<=
Re: find() and setting matrix elements to 1
,
Victor Semanic
,
2013/10/08
Prev by Date:
find() and setting matrix elements to 1
Next by Date:
Re: find() and setting matrix elements to 1
Previous by thread:
find() and setting matrix elements to 1
Next by thread:
Re: find() and setting matrix elements to 1
Index(es):
Date
Thread