MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Opportunities for recent engineering grads.
New to MATLAB?
I need to apply the OR operation to the column of a matrix. Here an example:
a=[0 0 1; 0 1 1];
[0 0 1]
Your example is not the 'OR', it is the 'AND', of the columns. The 'OR' of the columns is done this way:
b = any(a,1);
The 'AND' would be done this way:
b = all(a,1);
Direct link to this answer: