Rearranging assigned data in a required order
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
JAGAN MOHAN KUMMARI
am 29 Aug. 2018
0 Stimmen
6 Kommentare
Stephen23
am 29 Aug. 2018
The square brackets are superfluous:
b(c) % gives the answer
JAGAN MOHAN KUMMARI
am 29 Aug. 2018
JAGAN MOHAN KUMMARI
am 15 Sep. 2018
Stephen23
am 15 Sep. 2018
I suspect that you want this:
idx = xlsread('USDScoord.xlsx','Sheet1',''B:B');
mat = xlsread('US.xlsx','Sheet1','A:X');
mat(idx,:)
JAGAN MOHAN KUMMARI
am 15 Sep. 2018
Stephen23
am 15 Sep. 2018
@JAGAN MOHAN KUMMARI: check out the link in my answer.
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!