📅  最后修改于: 2022-03-11 15:01:04.732000             🧑  作者: Mango
% Direct indexing:
x = [1 2 3]
x(4) = 4
% Direct indexing other method:
x(end+1) = 4; % Note that end is a keyword and you do not need a variable called end
% Concatination
x = [x newval]
% Concatination other method
x = [x, newval]
% Concatination column vector
x = [x; newval]