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일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

질문:

2021년 4월 12일

댓글:

2021년 4월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by