Indexing problem with matrices
Mostrar comentarios más antiguos
Hi everyone, I've got a problem, I don't know if there's an easy solution.
I have two matrices:
A = [3 5 9 6 ; 2 1 13 6 ; 6 8 52 4 ; 13 6 8 22 ];
GRID = [linspace(1,100,100); rand(1,100); rand(1,100)]';
Each element of A is the index of the point of a structure. GRID sorts every point of the structure and associates the x and y coordinate in the 2nd and 3rd column.
The aim is to create a matrix Ax in which actually every element is the x coordinate of the correspondant A element (taken from the 2nd colum of GRID) and a a matrix Ay in which every element is the y coordinate of the correspondant A element (taken from the 3rd colum of GRID).
I cant use a for because A is very big and it takes too long. I dont know how to do.
Thanks to everyone
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!