MATLAB: Diff matrix in cell array

diff()matrix

Hello,
I have cell array where is 2000 matrix 4000×100. I would like to subtract each cell in matrix: A(i,j)-B(i,j+1). It is possible to use diff function for this operation? I have tried to do it, but I get same errors.
Y=arrayfun(@{diff(1,1,2)},A)
I would be grateful for any information you can provide.
Best regards

Best Answer

Given one cell array A, this seems to matche your example:
F = @(m)-diff(m,1,2);
Y = cellfun(F,A,'uni',0)