www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SumOfVectorElementsExample.m

    %% Sum of Vector Elements
% Create a vector and compute the sum of its elements.

% Copyright 2015 The MathWorks, Inc.

A = 1:10;
S = sum(A)