Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Matlabでベクトルの変数をプッシュする方法は?
このようなもの:
A = [5 2 3]; push(A, 7); % A = [5 2 3 7]
ありがとう。
私は答えを見つけました。
これを使って:
A = [A, 7];
またはこれ:
A(end + 1) = 7;
縦に積み上げたい場合は、
A = [A; 7]
しかし、これを実行するには、Aは次の引数と同じ次元である必要があります。たとえば、
A=[1,2 3,4]
長さ2のベクトルをAにスタックできます。
A = [A;5,6]