append in list matlab code example
Example: matlab list append
vector= [1 2 3];
vector(end+1)= 4
%% result
% vector= [1 2 3 4];
matrix [1 2 3; 4 5 6; 7 8 9];
matrix(1:end;end+1)=[10; 10; 10]
vector= [1 2 3];
vector(end+1)= 4
%% result
% vector= [1 2 3 4];
matrix [1 2 3; 4 5 6; 7 8 9];
matrix(1:end;end+1)=[10; 10; 10]