Calculating displacement many times with respect to different elements
조회 수: 2 (최근 30일)
이전 댓글 표시
I have the following data (or similar):
154240 1 7
154240 2 2
154240 5 6
154240 2 5
154240 6 7
154240 2 7
154240 5 6
154240 6 7
154240 4 6
154240 4 6
154240 4 6
641224 2 3
641224 2 1
641224 2 3
641224 1 2
641311 5 5
641311 7 5
It represents data of the form [tag number of rat, x coord, y coord] (as im studying a rat population). I would like to calculate the displacement of x & y with respect to the first x & y entries for each of the same value of the tag, i.e. I want an nx3 matrix (where n is size of my data) which gives me [tag number again,(0,x2-x1,x3-x1,x4-x1 etc),(0,y2-y1,y3-y1,y4-y1 etc)] but I am totally inept at programming and am flummoxed right now.
Any help is greatly appreciated!
댓글 수: 1
Sean de Wolski
2013년 1월 28일
So what output do you expect for you above input? Please describe to us how you get that. Results are worth a 1000 words!
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!