Write a function that takes as input a vector x and uses a for loop to calculate the sum of the vector x. It should output the sum of the vector.
조회 수: 6 (최근 30일)
이전 댓글 표시
I have no idea what to do and I'm not allowed to use built-in matlab functions
댓글 수: 2
Stephen23
2020년 2월 7일
Start by doing these tutorials:
Most of what you need to know is contained in them.
답변 (1개)
royed
2020년 2월 7일
In principle I shouldn't answer the question.
1) Define Array
2) for loop indexing the elements of the array till ir reaches the last element
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!