reconstruct matrix from vector coordinates
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
sz = [max(x),max(y)];
ix = sub2ind(sz,x,y);
mat = NaN(sz);
mat(ix) = data;
3 comentarios
Nicolas
el 25 de En. de 2017
Walter Roberson
el 25 de En. de 2017
Your x and y are not indices in the MATLAB sense.
Nicolas
el 25 de En. de 2017
Categorías
Más información sobre Descriptive Statistics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!