MATLAB: How to get rid of positive or negative values in a cell array

cell array

How do I create a cell array that consists of only positive or negative values of another cell array in a for loop?
For example, C is a cell 1×24 cell array consisting of 16×7 matrices. First, I need to get rid of the positive numbers in those matrices, second I need to turn the negative values into positives.
I hope I was clear.
Thanks.

Best Answer

for iC = 1:numel(C)
M = C{iC};
M(M > 0) = 0;
C{iC} = -M;
end