How can i divide the data in rows in MATLAB
古いコメントを表示
hello everyone, i hope you are doing well.
I have dataset of shape 4x4000;
i want to divide the data in rows like each row contain 1000 samples not 4000
so output shape is 16x1000
how can i do it in matlab
採用された回答
その他の回答 (1 件)
Arif Hoq
2022 年 3 月 2 日
use reshape function
A=load('newdata.mat');
dataset=A.dataset;
output=reshape(dataset,16,[]);
8 件のコメント
Med Future
2022 年 3 月 2 日
Arif Hoq
2022 年 3 月 2 日
try this one:
output=reshape(dataset,4,1000,[]);
Med Future
2022 年 3 月 2 日
Arif Hoq
2022 年 3 月 2 日
is that ?
output=reshape(dataset,16,1,[]);
Med Future
2022 年 3 月 2 日
Johan
2022 年 3 月 2 日
If you want to concatenate row by row then you can use:
res = [];
for i = 1:size(dataset,1)
res = [res;reshape(dataset(i,:),[],1000)];
end
Stephen23
2022 年 3 月 2 日
Ugh, do NOT concatenate row-by-row! That is an inefficient and complex approach.
Johan
2022 年 3 月 2 日
I did not think you could do that with transpose, thanks for the correction
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!