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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by