IF-statement for matrix/vector
103 views (last 30 days)
I have a 146652x1 matrix (vector) and I want to check each column for a defined condition. For example if the value is greater than 1.
IF "column_value" > 1
column_value / 0.001
So with this method, I wanto to checkout every single column in my matrix.
How do I code this?
KALYAN ACHARJYA on 15 Jan 2020
Edited: KALYAN ACHARJYA on 15 Jan 2020
As you mentioned that the matrix having size 146652x1, which means it has 1 column. Prefer logical conditional statement.
It's return logical data 1, where the value greater than 1, else 0.
If you mat data having multiple columns and rows, force all elements greater than 2 to be Zero
results=mat_data>1 & mat_data
If you wish to check individual cloumn data