From a large single column set of data, how can I get the differences between data points above and below each other?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
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
답변 (2개)
Andrei Bobrov
2014년 5월 17일
편집: Andrei Bobrov
2014년 5월 17일
datapoint - your vector
out = -diff(datapoint);
댓글 수: 3
Bob Marley
2014년 5월 17일
Andrei Bobrov
2014년 5월 17일
corrected :)
Jan
2014년 5월 17일
@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
2014년 5월 17일
While I prefer Andrei's suggestion (why does it not help you?), what about this:
result = datapoint(1:end - 1) - datapoint(2:end)
댓글 수: 0
이 질문은 마감되었습니다.
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!