I have the following cell array:
<20x2>
<32x2>
<28x2>
<30x2>
What I am trying to do is read into row 1
of the cell array which is <20x2>
and once I am in <20x2>
I would like to apply the following function to the first column only.
In the first one I would like every row of column 1
in C{1,1}
to be subtracted by 0.1. In the second one C{2,1}
(<32x2>
) I would like every row of column 1 to be subtracted by 0.2 and so on...
So to clarify I am trying to subtract n*0.1
from the first column of each submatrix in the cell array where n= row number of the cell array
. So if there was a section in the cell array in row 8
, column 1
would be subtracted by 8*0.1 = 0.8
I hope the question is clear enough, I have tried to word it as clear as I can.
Thanks in advance for any help/suggestions
Attempt
First = C{1,1}(:,1);
Subtraction = First - 0.1
Gives me my desired result but only for row 1 of my cell array.
Unique question to Applying function to vectors row by row because this involves a cell array as opposed to a matrix. The aspect of reading into a cell array makes it a different variant of the problem so if somebody was having a similar problem to this question the mentioned 'duplicate' question would not help, especially with little MATLAB knowledge like myself