File: matlab.actual

package info (click to toggle)
golang-github-alecthomas-chroma-v2 2.12.0-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 9,172 kB
  • sloc: xml: 38,564; python: 422; javascript: 357; sh: 37; makefile: 36
file content (10 lines) | stat: -rw-r--r-- 143 bytes parent folder | download | duplicates (7)
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)