MATLAB: Change variables of a matrix with conditions

conditionsMATLABmatricesmatrixmatrix manipulation

Hi Everyone!
I am attempting to solve a matrix however require assistance in regards to setting conditions.
The solution is for when the temperature is being illustrated with respect to time and certain parameters have been stated. The solution requires additional steps where the parameters vary with different temperatures ranges.
regards, Snipe

Best Answer

X = [...
150,156,165,174,182,191,199,207,215,222,230,238,245,252,259,266,273;...
150,155,164,172,180,188,195,203,211,218,226,233,240,247,254,261,263;...
150,155,162,170,177,185,192,200,207,214,222,229,236,243,250,257,263;...
150,154,161,168,175,182,189,196,203,210,217,224,231,238,245,252,259];
V = [150,200,250]; % edges
Z = sum(bsxfun(@gt,X,reshape(V,1,1,[])),3)
and then use Z pick your conditions:
Z =
0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3
0 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3
0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3
0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3