Info
This question is closed. Reopen it to edit or answer.
From a large single column set of data, how can I get the differences between data points above and below each other?
1 view (last 30 days)
Show older comments
I have this problem whereby i need to find the difference between a single column set of data. For example, datapoint1-datapoint2...datapoint2-datapoint3...datapoint3-datapoint4 and so on for 170 data points. I want to find a way in which i can display these differences in a vector without having to tediously write every single data point subtraction.
0 Comments
Answers (2)
Andrei Bobrov
on 17 May 2014
Edited: Andrei Bobrov
on 17 May 2014
datapoint - your vector
out = -diff(datapoint);
3 Comments
Jan
on 17 May 2014
@Bob: Please do not only claim, that it does not help you. It would be more useful if you explain, which problems you have.
Jan
on 17 May 2014
While I prefer Andrei's suggestion (why does it not help you?), what about this:
result = datapoint(1:end - 1) - datapoint(2:end)
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!