필터 지우기
필터 지우기

Mapping two matrices

조회 수: 1 (최근 30일)
Bilen Oytun Peksel
Bilen Oytun Peksel 2011년 9월 9일
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

채택된 답변

Jan
Jan 2011년 9월 9일
[fS, index] = sort(f(:));
out = [fS, SPL(index)];
  댓글 수: 1
Bilen Oytun Peksel
Bilen Oytun Peksel 2011년 9월 9일
thanks right to the point.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by