Add columns into one column with each run

1 回表示 (過去 30 日間)
Ferdinand Grosse-Dunker
Ferdinand Grosse-Dunker 2019 年 9 月 29 日
編集済み: KALYAN ACHARJYA 2019 年 9 月 29 日
Hi there,
I have a column / n x1 double:
F = [0.23
0.44
0.31
...]
With each repetition of my Matlab script I would like to add the new column F (the length n of F varies each time) to a data column/double
data = 0.23
0.44
0.31
....
0.21
0.11
0.34
...]
In the end I would like to calculate the mean, std, and histogram of all values.
Maybe this also woks with a table, if I add each new column into one existing table? And then calculate the mean, std of all entries in the table?

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 9 月 29 日
編集済み: KALYAN ACHARJYA 2019 年 9 月 29 日
"Add columns into one column with each run"
F=rand(10,1);
[r c]=size(F);
num_of_colm=10; % mention how many column you want to add
F=[F zeros(r,num_of_colm-1)];
for i=2:num_of_colm
F(:,i)=rand(r,c);
end
F

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by