MATLAB: How to use an an if statement which has two criteria to be met to create a new table

conditional statementscriteria statementMATLAB

(apologies if the explanation is hard to follow – I'm struggling to describe it!)
I have a table and I want to create a sub-table of it, if a certain criteria is met.
There are two criteria, either of which is sufficient to join the new table: 1) if the value in one column 1 meet a certain critera, or if the value in column 1 doesn't meet the criteria but the value in column 2 does meet a new criteria.
To expand on the data and the challenge I've attached a photo of the data in a simplified format (and the new table that I am trying to create – with eliminated columns in red).
I have water stress data (where 1 = not stressed, 2 = moderately stressed, 3 = stressed) and flooding risk data (where the number represents increased flooding risk) for ten parcels of land. I want to create a table where all the data are either not stressed (water stress value < 2) or water stress values are above 1 but flooding risk are non-zero.
I've tried a few options using the conditionals but not really made any progress – any help would be greatly appreciated – thanks!Matlab_question_picture.png

Best Answer

>> W=[1 2 1 2 1 3 2 0 0 2].';
>> F=[0 0 2 2 0 0 3 3 0 0].';
>> ix=(W<2) | (W>1 & F>0);
>> [W(ix) F(ix)]
ans =
1 0
1 2
2 2
1 0
2 3
0 3
0 0
>>