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 で知りたいです。
次の行のような for ループがある場合:
b=[1 2 3 4]; for i=1:1:10 x=i.*b end
コードは、スカラー倍のベクトル b を i 回繰り返します。しかし、すべての反復の結果のベクトルを格納するために for ループ x(i) を入れると、探しているものが得られません。私が探しているのは、取得することです:
x(1)=[1 2 3 4] x(2)=[2 4 6 8] ... and so on