Hello.
I want to flatten and split and concatenate arrays in several files.
For example,
I have several datasets (237 x 40, 238 x 40, 239 x 40 ….)
1. I want to flatten each dataset
(237 x 40 -> 1 x 9480 , 238 x 40 => 1 x 9520, 239 x 40 = > 1 x 9560)
2. I want to split each datasets to minimum length among datasets.
1 x 9480, 1 x 9480, 1 x 9480
3. concatenate (3 x 9480)
I can do as several codes, but I have lots of data.
So I want to reduce the code.
clear allclose allX = csvread('boxing/boxing50.csv');Y = csvread('boxing/boxing51.csv');Z = csvread('boxing/boxing52.csv');% flatten
X = reshape(X,[],1);Y = reshape(Y,[],1);Z = reshape(Z,[],1);% find the minimum and split to the minimum length
X = X(:,1:9480)Y = Y(:,1:9480)Z = Z(:,1:9480)% concatenate
All = [X; Y; Z]
Best Answer