create vector from 21 individual values from for-loop

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?

回答(1 个)

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 个评论

for i=(1:21)
test=squeeze(A(i,:,:));
V=test(tril(true(size(test))));
K=kurtosis(V)
end
I used this to get 21 values for K. I need to get the 21 Ks into a boxplot ultimately. I figured making it into a vector would be the first step.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

提问:

aet
2019-6-10

评论:

aet
2019-6-10

Community Treasure Hunt

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

Start Hunting!

Translated by