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.

Réponses (1)

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

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by