This statement is not inside any function.
Mostra commenti meno recenti
function sumVector = computeSum(vector)
sumVector = 0;
for i = 1:length(vector)
sumVector = sumVector + vector(i);
end
end
V = 1:10;
totalSum = computeSum(V);
disp(['Sum of elements in vector V is ' num2str(totalSum)]);
Error: File: computeSum.m Line: 9 Column: 1
This statement is not inside any function.
(It follows the END that terminates the definition of the function "computeSum".)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Adding custom doc in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!