MATLAB: Subtract two data points in a cell array

cell arrays

Hi. I have a cell array Sa (338 X 1929). I want to subtract two points (which are numbers). For example: Sa(i,2)-Sa(i-1,2). Matlab doesn't do that as they are cell array type. Is there any way to do this?

Best Answer

You are trying to subtract the cells, rather than the contents of the cells. Try
Sa{i,2}-Sa{i-1,2}