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

    %% Add Vector to Matrix
% Create an array, |A|, and add a column vector to it. The vector is
% treated as though it is a matrix of the same size as |A|, so that each
% element in the vector is added to a row in |A|.
A = [1 2 3; 4 5 6]

%%
b = [10; 100]

%%
A + b