Borrar filtros
Borrar filtros

Mapping two matrices

1 visualización (últimos 30 días)
Bilen Oytun Peksel
Bilen Oytun Peksel el 9 de Sept. de 2011
Hi! My question is :
I have two n x n matrices one being pressure levels(SPL) and the other one being the frequency (f) of each and every SPL. Their indices are of course the same since the matrices are identical in shape. I need to sort the f matrix and put it into a 1D vector form and I want the SPL matrix to follow.
How could I do this? Thanks

Respuesta aceptada

Jan
Jan el 9 de Sept. de 2011
[fS, index] = sort(f(:));
out = [fS, SPL(index)];
  1 comentario
Bilen Oytun Peksel
Bilen Oytun Peksel el 9 de Sept. de 2011
thanks right to the point.

Iniciar sesión para comentar.

Más respuestas (1)

Andrei Bobrov
Andrei Bobrov el 9 de Sept. de 2011
out = [f(:) SPL(:)]
with sort
out = sortrows([f(:) SPL(:)],1);
  1 comentario
Bilen Oytun Peksel
Bilen Oytun Peksel el 9 de Sept. de 2011
Sorry, I should add the f matrix should be ascending. I mean any kind of operation I apply on f should effect SPL identically.

Iniciar sesión para comentar.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by