How to shuffle fileDatastore
Afficher commentaires plus anciens
Hi,
I tried to shuffle fileDatastore, but failed.
Any method how to do it?
Réponses (1)
Ayush Laddha
le 19 Juin 2020
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 commentaires
Haoqing Li
le 19 Juin 2020
Modifié(e) : dpb
le 14 Juil 2020
Ayush Laddha
le 22 Juin 2020
Hi,
It works perfectly fine for me. I am not able to reproduce the issue you are facing. It would be great if you could provide more info about the MATLAB version you are using?
Haoqing Li
le 1 Juil 2020
dpb
le 14 Juil 2020
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'.
>>
Catégories
En savoir plus sur Text Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!