reconstruct matrix from vector coordinates
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
sz = [max(x),max(y)];
ix = sub2ind(sz,x,y);
mat = NaN(sz);
mat(ix) = data;
3 Commenti
Nicolas
il 25 Gen 2017
Walter Roberson
il 25 Gen 2017
Your x and y are not indices in the MATLAB sense.
Nicolas
il 25 Gen 2017
Categorie
Scopri di più su Descriptive Statistics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!