File: matlab.actual

package info (click to toggle)
golang-github-alecthomas-chroma 0.10.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,652 kB
  • sloc: python: 426; javascript: 79; makefile: 34; sh: 32
file content (10 lines) | stat: -rw-r--r-- 143 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
% 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)