subtract two data points in a cell array
1 次查看(过去 30 天)
显示 更早的评论
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?
1 个评论
Image Analyst
2014-12-5
After you read the FAQ you will know all about cells and won't need to ask a question like this. See http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F I think it gives a good intuitive description for what cells are an how to use them. Then you will understand why the cyclists answer works.
采纳的回答
the cyclist
2014-12-5
You are trying to subtract the cells, rather than the contents of the cells. Try
Sa{i,2}-Sa{i-1,2}
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!