필터 지우기
필터 지우기

How to partition a data set.

조회 수: 8 (최근 30일)
Silpa K
Silpa K 2020년 3월 11일
답변: Raunak Gupta 2020년 3월 19일
How can I partition a data set into a specified number of partition. I need to divide my data as 6 partition. I used
subds = partition(ds,n,index). How can I do that?
Please help me.

답변 (1개)

Raunak Gupta
Raunak Gupta 2020년 3월 19일
Hi,
I assume you have dataset in some file format that can be read by any of the datastore mentioned here. The partition function will return a partition of that datastore with is indexed by variable idx. For example, the datastore has 36 files and you want to partition it into 6 datastore, so each partition will have 6 files. Each partition can be called with the help of index. Below example can clarify further.
% Let's say ds is the datastore with 36 files
subds1 = partition(ds,6,1); % contains files 1-6
subds2 = partition(ds,6,2); % contains files 7-12
subds3 = partition(ds,6,3); % contains files 13-18
subds4 = partition(ds,6,4); % contains files 19-24
subds5 = partition(ds,6,5); % contains files 25-30
subds6 = partition(ds,6,6); % contains files 31-36
Hope it helps!

카테고리

Help CenterFile Exchange에서 Datastore에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by