reconstruct matrix from vector coordinates
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
sz = [max(x),max(y)];
ix = sub2ind(sz,x,y);
mat = NaN(sz);
mat(ix) = data;
3 Kommentare
Nicolas
am 25 Jan. 2017
Walter Roberson
am 25 Jan. 2017
Your x and y are not indices in the MATLAB sense.
Nicolas
am 25 Jan. 2017
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!