Array Operation with using another array

조회 수: 1 (최근 30일)
Afiye Havva Geçgel
Afiye Havva Geçgel 2019년 5월 29일
답변: Kevin Phung 2019년 5월 29일
I have 2 different arrays as
k=[4 9 3 3 6 8 8 12 6]
m=[1 2 6 7]
i need to reach the summation of
k(1)+k(2)+k(6)+k(7)
how can i do this with for loop?

채택된 답변

Kevin Phung
Kevin Phung 2019년 5월 29일
sum(k(m))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by