Can you please help me.

1 回表示 (過去 30 日間)
Jesus Flores
Jesus Flores 2021 年 3 月 29 日
回答済み: Mahesh Taparia 2021 年 4 月 1 日
Write a function that takes a vector as input and returns the sum of every other value in the vector, starting with the first value. Name your function whatever you like
  1 件のコメント
DGM
DGM 2021 年 3 月 29 日
That's not a question. Do you have a question about your attempts to implement such a function?
Hint: 1:2:length(vector)

サインインしてコメントする。

採用された回答

Mahesh Taparia
Mahesh Taparia 2021 年 4 月 1 日
Hi
To define a function, you can refer this documentation on function creation. To add all the vector elements, you can refer this example. Hope it will help!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by