I'm trying to get a logical matrix as a result of a condition that is specific for each column M(:,i)
of the original matrix, based on the value of the same index i
in vector N
, that is, N(i)
.
I have looked this up online, but can't find anything quite like it. There must be a simple and clean way of doing this.
M =
3 -1 100 8
200 2 300 4
-10 0 0 400
N =
4 0 90 7
and my desired solution is, for each column of M(:,i)
, the values less than N(i)
:
1 1 0 0
0 0 0 1
1 0 1 0