Matrix creation which identify link of vehicles
이전 댓글 표시
Hello.
I've a matrix 61312*3.
1st column: from 1 to 81 (Origin place of a vehicle) 2nd column: from 1 to 81 (Destination place of a vehicle) 3rd column: from 1 to 246 (where the vehicle has surveyed)
There are 61312 observation (no. of rows) at 246 locations.
I need to create a matrix which shows that from origin (1 to 81) to Destination (1 to 81) which location (1 to 246) these vehicle follow. I think the order of the matrix will be 81*81.
Kindly let me know how should I proceed. thanks in advance.
채택된 답변
추가 답변 (1개)
Jos (10584)
2014년 7월 11일
1 개 추천
M = accumarray(A(:,[2 3]), A(:,1), [81 81], @(x) {x})
카테고리
도움말 센터 및 File Exchange에서 Licensing on Cloud Platforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!