create vector from 21 individual values from for-loop

1 回表示 (過去 30 日間)
aet
aet 2019 年 6 月 10 日
コメント済み: aet 2019 年 6 月 10 日
I have 21 values for K from my for-loop and need to makes these values into a vector. The end goal is to make a box plot. Any guidance?
  2 件のコメント
Bob Thompson
Bob Thompson 2019 年 6 月 10 日
Are you indexing the results?
aet
aet 2019 年 6 月 10 日
Yes

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2019 年 6 月 10 日
K = zeros(1, 21); % Pre-allocation
for ii = 1:21
K(ii) = rand; % Insert your calculations here
end
If you post your code, a more matching answer is possible.
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 6 月 10 日
K(i) = kurtosis(V);
aet
aet 2019 年 6 月 10 日
This worked! Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by