필터 지우기
필터 지우기

Reassigning Values to sorted indices from a set of labels

조회 수: 1 (최근 30일)
AR
AR 2015년 12월 8일
댓글: AR 2015년 12월 10일
I'm looking to re-assign values on a column-sorted matrix, I:[1510 700], from a vector of labels, L:[1510,1]. I sorted measurements of elements in each column of E: [1510 700]. Each measurement in the each column, prior to sorting, was associated with a set of labels in L:[1510 1]
so after sorting E my I matrix looks like (extract):
I 143 56 99 63 497 142 127 24 71 498 14 128 122 82 13 15 11 140 88 119 61 35 66 1 144
I'd like to grab the corresponding value from value from L:[1510 1] and replace it into its cell. So for cell I(1,1) which has a value of 143, I'd like to grab the 143rd row's value from L:[1510 1] and put it in cell I(1,1).
Any solutions would be appreciated.
  댓글 수: 1
AR
AR 2015년 12월 8일
sorry, I: [1510 700] extract above looks like this
I: (1:5, 1:5)
143 56 99 63 497
142 127 24 71 498
14 128 122 82 13
15 11 140 88 119
61 35 66 1 144

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

채택된 답변

Adam
Adam 2015년 12월 8일
L(I)
should give what you want, if I understand correctly what you are asking, assuming you actually have data arrays despite talking about cells.
  댓글 수: 1
AR
AR 2015년 12월 10일
Adam, This was an efficient way which worked great. Thank you. --Allen

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

추가 답변 (0개)

카테고리

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