How can I divide a data set in to small data sets of equal length

3 ビュー (過去 30 日間)
Khan Engr
Khan Engr 2018 年 9 月 27 日
コメント済み: Khan Engr 2018 年 9 月 27 日
I have a data set 'A' of 50000 samples (sampling time 1e-4sec) and want to divide this data set into small data sets, each small data set having 100 samples. And then have them in the form such as; A1, A2, A3, ....A500, so that I can use them further. (the small data sets are in a sequence such as A1= A(1:100), A2=A(101:200), A3=A(201:300), ..... A500)
I Will be grateful for kind help.

採用された回答

KSSV
KSSV 2018 年 9 月 27 日
Read about reshape
A = rand( 50000 ,1) ;
B = reshape(A,100,[]) ;
  3 件のコメント
KSSV
KSSV 2018 年 9 月 27 日
YOu need not assign a different name to each data.....you can access them by using the matrix indexing.
B(:,1) % this gives B1
B(:,7) % this gives B7
Khan Engr
Khan Engr 2018 年 9 月 27 日
Great, its working so well and simplified approach, thanks a lot for your help :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by