Add columns into one column with each run
Afficher commentaires plus anciens
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?
Réponses (1)
KALYAN ACHARJYA
le 29 Sep 2019
Modifié(e) : KALYAN ACHARJYA
le 29 Sep 2019
"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
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!