how to extract data from .mat file?

13 ビュー (過去 30 日間)
Faheem Ur Rehman
Faheem Ur Rehman 2021 年 4 月 12 日
コメント済み: Stephen23 2021 年 4 月 12 日
I have dataset in h5 format and i read that data using
x = hdf5read(file.GroupHierarchy.Datasets(1));
now x contain 2x1024x31200, I want to extrace 2x1024x10000 from it.

採用された回答

SungJun Cho
SungJun Cho 2021 年 4 月 12 日
編集済み: SungJun Cho 2021 年 4 月 12 日
If you want to extract first 10000 elements from the x, you can just do
extracted_x = x(:,:,1:10000);
% Or if you want specific indexing
begin = 101;
conclude = 10100;
extracted_x = x(:,:,begin:conclude);
Also, just for your information, MATLAB now recommends h5read instead of hdf5read (c.f. here).
Hope this helps.
  2 件のコメント
Faheem Ur Rehman
Faheem Ur Rehman 2021 年 4 月 12 日
how can i change 2x1024x31200 to 31200x1024x2?
Stephen23
Stephen23 2021 年 4 月 12 日

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by