This statement is not inside any function.
Mostrar comentarios más antiguos
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".)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Adding custom doc en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!