Retrieving only one field in a struct

19 ビュー (過去 30 日間)
PARIVASH PARIDAD
PARIVASH PARIDAD 2018 年 12 月 10 日
回答済み: Fangjun Jiang 2018 年 12 月 10 日
I have an array of X=1*1 sturct with 4 fields.
x has the value of 1*726 double
y has the value of 1*656 double
z has the value of 656*726 int16
info has the value of 1*1 struct
These data are from a satellite.hdr image that I used the 'enviread' command to read them. I want to retrieve only the z field since it has the values that I need. I used
value = getfield(X,z);
but it does not show only the z field values.
How can I solve this please?

採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 12 月 10 日
value=getfield(X,'z')

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by