Dear all; I have two vectors as seen below , and I want change position between them depend on vector b. The results should be: a=[73 312 135 192 0 122]; b=[2 1 5 4 6 3];
result=[ 312 73 0 192 122 135];
I tried result(b) = a; % and not work.
please help and Thanks in advance.

 채택된 답변

Star Strider
Star Strider 2016년 12월 25일

0 개 추천

This works:
a=[73 312 135 192 0 122];
b=[2 1 5 4 6 3];
Result = a(b)

댓글 수: 2

skysky2000
skysky2000 2016년 12월 25일
Thanks alot Star Strider, its work, that really what I want.
Star Strider
Star Strider 2016년 12월 25일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2016년 12월 25일

댓글:

2016년 12월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by