How to check if object's property is read-only.
15 ビュー (過去 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!