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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by