reconstruct matrix from vector coordinates
이전 댓글 표시
Hello, I have 3 vectors (x,y,data) each equals 1x6358. How can I recreate the matrix DATA based on the indices x and y? Thank you
채택된 답변
추가 답변 (1개)
sz = [max(x),max(y)];
ix = sub2ind(sz,x,y);
mat = NaN(sz);
mat(ix) = data;
댓글 수: 3
Nicolas
2017년 1월 25일
Walter Roberson
2017년 1월 25일
Your x and y are not indices in the MATLAB sense.
Nicolas
2017년 1월 25일
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!