필터 지우기
필터 지우기

check if a variable in a structure exist

조회 수: 202 (최근 30일)
Alon
Alon 2014년 4월 16일
댓글: Alon 2014년 4월 16일
Hello, I must check if the variable handles.Y2 exists in the structure handles(I work with gui). Using exist gives me 0 although it exist in the structure thanks

채택된 답변

dpb
dpb 2014년 4월 16일
isfield(handles,'Y2')
doc isfield % for details
help struct % for reminder on structures

추가 답변 (1개)

Sara
Sara 2014년 4월 16일
Use:
ispresent = isfield(handles,'Y2')
See
help isfield
for more infos.

카테고리

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