mirror of
https://github.com/alecthomas/chroma.git
synced 2025-02-13 13:28:27 +02:00
11 lines
143 B
Plaintext
11 lines
143 B
Plaintext
% a sum function
|
|
function p = vector_sum(x)
|
|
p = 0;
|
|
for k1 = 1:length(x)
|
|
p = p + x(k1);
|
|
end
|
|
end
|
|
|
|
z = 1:10;
|
|
sum_from_1_to_10 = vector_sum(z)
|