フィルターのクリア

In an assignment A(I) = B, the number of elements in B and I must be the same.

1 回表示 (過去 30 日間)
Rohan Repale
Rohan Repale 2013 年 3 月 27 日
Now, I understand the problem here, what I don't understand however is that how should 'I' be initialized??
For instance, in my case variable 'p' generates an array at the end of every for loop, which is programmed to run for 101 times. The output of p looks something like this
p =
-0.0149 -0.0149
Now, I want to store this value into another variable.
So,What should be the dimension of that variable?
I have tried initializing ---> A=rand(2,101);
Thanks, Rohan

採用された回答

Walter Roberson
Walter Roberson 2013 年 3 月 27 日
A = zeros(2, 101);
for K = 1 : 101
p = rand(1,2);
A(:,K) = p;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by