how get it?
이전 댓글 표시
a=magic(5)
b=[1 3 2 4 5]
i want to get:
in 1 column i want to 1 element
in 2 column i want to 3 element
in 3 column i want to 2 element
in 4 column i want to 4 element
in 5 column i want to 5 element
ans:
17 6 7 21 9
채택된 답변
추가 답변 (1개)
a = magic(5)
b = [1 3 2 4 5]
v = arrayfun(@(i)a(b(i),i),1:size(a,2))
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!