I want to check if the elements of my matrix are smaller than zero then I want to assign zero to them, in matlab it was done using this:
ind = find(floatFrame < 0);
floatFrame(ind) = 0;
Is there any equivalent for Eigen matrices?
I want to check if the elements of my matrix are smaller than zero then I want to assign zero to them, in matlab it was done using this:
ind = find(floatFrame < 0);
floatFrame(ind) = 0;
Is there any equivalent for Eigen matrices?
You can use the select function, which is similar to the ternary ?:
operator in C. For your example:
floatFrame = (floatFrame < 0).select(0, floatFrame)