hfive2struct文档

h5structHDF5数据装入一个Matlab结构与原始文件相同层次结构。

回到气候数据工具的内容

内容

语法

data = hfive2struct(文件名)数据= hfive2struct(文件名,数据集)数据= hfive2struct(文件名,数据集,真的)数据= hfive2struct(文件名,[],真的)

描述

data = hfive2struct(文件名)加载所有attibutes,数据值和数据集的卡拉季奇h5文件名的Matlab结构与原始文件相同层次结构。(currenlty处理11组的水平)

data = hfive2struct(文件名,数据集)只加载请求的数据集和attibutes文件名到Matlab相关结构与原始文件名相同的层次结构。数据集是完整的h5路径所需的数据集。数据集可以被指定为一个字符串或单元阵列的刺如/路径/ /数据集或{路径/ / dataset1路径/ / dataset2}。

data = hfive2struct(文件名,数据集,fill_with_nan)只加载请求的数据集和相关的文件名attibutes Matlab结构。如果fill_with_nan = true,所有单引号和双数据集有一个_FillValue _FillValue nan所取代。

用户输入

示例1

加载所有数据从一个h5文件:

D = h5struct (“altimetry_example.h5”);

现在这里的结构化内容D

D
D =结构体字段:高度:[1×1 struct]纬度:[1×1 struct]经度:[1×1 struct]属性:[1×1 struct] ancillary_data: [1×1 struct] instrument_parameters: [1×1 struct]

访问的一个领域D,遵循D与一个然后字段名。例如,访问高程数据,这样做是这样的:

D.elevation
ans =结构体字段:价值:[236379×1单]属性:[1×1 struct]

高程测量位于D.elevation.Value领域,高程数据中可以找到的信息D.elevation.Attributes。这里是高程数据的属性:

D.elevation.Attributes
ans =结构体字段:h5es_id: 4单位:“米”long_name:“海拔”standard_name:“海拔”描述:激光点的高程以上椭球”

情节高程和信号强度作为一个三维散点图:

图scatter3 (D.longitude。价值,D.latitude。价值,D.elevation.Value,2 D.instrument_parameters.rcv_sigstr.Value“填充”)%添加一个网格和一些标签:网格包含(D.longitude.Attributes.units“翻译”,“没有”);ylabel (D.latitude.Attributes.units“翻译”,“没有”);zlabel (D.elevation.Attributes.units“翻译”,“没有”);cb = colorbar;D.instrument_parameters.rcv_sigstr.Attributes.long_name ylabel (cb)轴

示例2

如果你只需要一些数据在一个HDF5文件,你可能更愿意只加载数据方法如下:

数据集= {“/ instrument_parameters / rel_time”,' /海拔'};D = h5struct (“altimetry_example.h5”数据集);

这一次我们只加载高程数据和相对时间。这就是D看起来像:

D
D =结构体字段:instrument_parameters: [1×1 struct]海拔:[1×1 struct]

类似于示例1,情节标高和相对时间

图绘制(D.instrument_parameters.rel_time。价值,D.elevation.Value,“。”,“markersize”,0.5)%添加一个网格和一些标签网格包含(D.instrument_parameters.rel_time.Attributes.units“翻译”,“没有”);ylabel (D.elevation.Attributes.units“翻译”,“没有”);轴

作者信息

这个函数和支持文档写的亚历克斯·s·金宝app加德纳姓名,2018年10月。