필터 지우기
필터 지우기

Rearranging assigned data in a required order

조회 수: 1 (최근 30일)
JAGAN MOHAN KUMMARI
JAGAN MOHAN KUMMARI 2018년 8월 29일
댓글: Stephen23 2018년 9월 15일
Hi,
I want to read an excel file of two columns. Column A is assigned with values in Column B.
Ex:
Col A 1 2 3 4 5 6 7 8 9 10
Col B 10 8 5 25 31 12 29 1 21 44
How can I get the output of Column B reassigned to any specific order of Column A
Ex: o/p for the following order of
Col A 2 6 8 4 9 3 1 5 7 10
as
Col B 8 12 1 25 21 5 10 31 29 44
Thank you.

채택된 답변

Stephen23
Stephen23 2018년 8월 29일
편집: Stephen23 2018년 8월 29일

추가 답변 (1개)

JAGAN MOHAN KUMMARI
JAGAN MOHAN KUMMARI 2018년 8월 29일
Thanks, Stephen!
Got it.
a=xlsread('values.xls');
b=a(:,2)
c=a(:,3) % col c is the required order from a
b([c]) % gives the answer
Thanks.
  댓글 수: 6
JAGAN MOHAN KUMMARI
JAGAN MOHAN KUMMARI 2018년 9월 15일
True. Got it. I need more learning. Getting familiar with things.
Thanks mate!
Stephen23
Stephen23 2018년 9월 15일
@JAGAN MOHAN KUMMARI: check out the link in my answer.

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

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by