How to shuffle fileDatastore

조회 수: 2 (최근 30일)
Haoqing Li
Haoqing Li 2020년 6월 18일
댓글: dpb 2020년 7월 14일
Hi,
I tried to shuffle fileDatastore, but failed.
Any method how to do it?

답변 (1개)

Ayush Laddha
Ayush Laddha 2020년 6월 19일
I understand that you wish to shuffle the fileDatastore. You can utilize the shuffle function to do so. You can use it as given below –
fs = fileDatastore(path, 'ReadFcn', @load)
shuffled_fs = shuffle(fs)
Link to its documentation –
  댓글 수: 4
Haoqing Li
Haoqing Li 2020년 7월 1일
Hi,
I'm using 2020a.
dpb
dpb 2020년 7월 14일
I get same error on R2019b as does Haoqing LI (another poster just asked same Q? and this thread showed up in the automated links system so came to investigate).
Dunno' what is different w/ the release Ayush Laddha used, but
>> ds=fileDatastore('3*.xlsx','ReadFcn',@readtable)
ds =
FileDatastore with properties:
Files: {
'C:\Users\...\Documents\MATLAB\Work\3-15-17.xlsx';
'C:\Users\...\Documents\MATLAB\Work\3-16-17.xlsx';
'C:\Users\...\Documents\MATLAB\Work\3-17-17.xlsx'
}
UniformRead: 0
ReadMode: 'file'
BlockSize: Inf
PreviewFcn: @readtable
ReadFcn: @readtable
AlternateFileSystemRoots: {}
>> ds=shuffle(ds)
Undefined function 'shuffle' for input arguments of type 'matlab.io.datastore.FileDatastore'.
>>

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Measurements and Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by