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.
i=1 から 10 までを考えてみましょう。i の奇数位置に対してのみランダムな番号を生成したいと考えています。そのための機能や方法はありますか?助けてください。
x = zeros(10,1); があるとします。
少し面倒ですが、タスクは次のように実行できます: x(1:2:end) = rand(size(x(1:2:end)))