How to push a variable in a vector in Matlab?

299 次查看(过去 30 天)
Something like this:
A = [1 2 3];
push(A, 4); % Something like Push
% A = [1 2 3 4]
Thanks.

采纳的回答

Matt J
Matt J 2013-2-7
编辑:Matt J 2013-2-7
A(end+1)=4;
or
A=[A,4];

更多回答(1 个)

Jozef Lukac
Jozef Lukac 2020-12-29
I have created an immitation of STL vector in Matlab. Check it out. :)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by