a question about datastore

3 ビュー (過去 30 日間)
alpedhuez
alpedhuez 2022 年 6 月 18 日
コメント済み: alpedhuez 2022 年 6 月 28 日
Would you help me understand the point of datastore?
Suppose I read an excel sheet with muliple sheets using datastore. I want to create a table that includes all variables in Sheet 1, Sheet 2, .... How can one do this?
  3 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 19 日
One of the very common operations is to loop over a collection of files, processing each file. Even without the facilities that permit datastore to read partial files, datastore offers a more organized way of looping over colllections of file.
You start to see more of the power of data stores when you start using transformation steps, such as augmentedImageDatastore which can automatically handle resizing of images and automatically handle conversion to grayscale or rgb -- and also potentially random rotations and translations.
alpedhuez
alpedhuez 2022 年 6 月 19 日
That is true.

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

採用された回答

Pooja Kumari
Pooja Kumari 2022 年 6 月 28 日
Dear Alpedhuez,
It is my understanding that you want to know about the point of Database and want to create a table from excel sheet with multiple sheet that include all variable stored in Sheet 1, Sheet 2.
Datastore is a repository for collection of data that are too large to fit in memory and datastore function builds one.
A datastore is an object for reading a single file or a collection of files or data.
You can refer to the following document to get a better understanding of the same:
You can read an excel sheet with multiple sheets using ‘spreadsheetDatastore’ function.
ssds = spreadsheetDatastore(location)
%This command will create a spreadsheet Datastore object from collection of data
You can store all the variable in the excel sheet in Sheet1, Sheet2 by using this piece of code:
ds = spreadsheetDatastore("your_excel_sheet.xlsx");
ds.Sheets = [1 2]; % if your excel sheet has 2 sheet as Sheet1 and Sheet2
% If you want to take all the sheets present in your excel sheet, you can pass " " (blank string)
You can refer to the given link below for more information on spreadsheetDatastore :
Sincerely,
Pooja Kumari
  1 件のコメント
alpedhuez
alpedhuez 2022 年 6 月 28 日
Thank you. Then how can one export ds.Sheets to a table?

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by