I have a cell array where each cell contains a matrix of identical size. How do I efficiently set the last entry of each matrix in the array? I was trying to make use of cellfun but it doesn't look like assignment is possible.
Minimal working example (the most efficient implementation I could come up with):
C = cell(5, 6, 7);
[C{:}] = deal(ones(10, 1));
for i = 1:5
for j = 1:6
for k = 1:7
C{i,j,k}(end) = 0;
end
end
end