MATLAB: How to Set whole Array column to Nan if a specific value is that column is present

matrix arraymatrix manipulation

As the Questions says i want to kinda "mark" and replace all values of a column with NaNs, in which ONE of the values fullfill the following condition:
tmpTemp(:,maxTemp < minTempMeanTresh) = NaN;
minTempMeanTresh is a certain Treshhold (preset) and an array maxTemp of same size like tmpTemp (48×62) is given. If any value in one column is lower then the treshold i want to set this whole column to NaN. The code doesnt work it kinda does some repmat, which i do not understand (size is way larger). Thank u for your help!

Best Answer

tmpTemp(:, any(maxTemp < minTempMeanTresh, 1)) = NaN;