How to check if object's property is read-only.
조회 수: 14 (최근 30일)
이전 댓글 표시
Hello,
How to check if object's property is read-only or how to get the list of all the writable properties in any other way than trying to write it?
댓글 수: 0
채택된 답변
Matt J
2020년 7월 22일
편집: Matt J
2020년 7월 22일
You can obtain that information from a metaclass object for the class,
In this case, it would look something like this:
>> meta=?myclass; pmeta=meta.PropertyList;
>> pmeta
pmeta =
2×1 property array with properties:
Name
Description
DetailedDescription
GetAccess
SetAccess
Dependent
Constant
Abstract
Transient
Hidden
GetObservable
SetObservable
AbortSet
NonCopyable
GetMethod
SetMethod
HasDefault
DefaultValue
Validation
DefiningClass
>> pmeta.SetAccess
ans =
'public'
ans =
'public'
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!