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!