MATLAB Answers

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 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by