findPropByAttr

版本 1.0.0 (2.4 KB) 作者: Jiri Dostal
Find class/object properties by their attributes.
14.0 次下载
更新时间 2018/11/22

查看许可证

Syntax: [props, metaprops] = findPropByAttr(classnameOrObject,"Name,Value,..")

Inputs:
classnameOrObject - class name (as character array) or an instantiated
object.
"Name, Value,..." - specify class property attribute value filter. The
attribute values should match a variable type of the
metaproperty (e.q. char -> char). The value of the
attribute "DefiningClass" is specified as a character
array.

Outputs:
props - list of names of properties suiting the requirements.
metaprops - metaproperty objects for the listed properties.

Example:

% --- List property attributes
[~,mp] = findPropByAttr('table');
mp(1)

% --- List 'Copyable' properties
p = findPropByAttr('table','NonCopyable',0)

% or equivalently
t = table; % instantiate and object
p = findPropByAttr(t,'NonCopyable',0)

% --- List 'GetAccess' = 'private' or 'protected' properties defined by the
% class itself. Multiple options can be specified using a cell array.
p = findPropByAttr('table',...
'GetAccess',{'private','protected'},...
'DefiningClass','table')

Copyright (c) 2018, Jiri Dostal (jiri.dostal@cvut.cz)
All rights reserved. BSD Licence.

引用格式

Jiri Dostal (2024). findPropByAttr (https://www.mathworks.com/matlabcentral/fileexchange/69499-findpropbyattr), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Develop uifigure-Based Apps 的更多信息
致谢

启发作品: EnergyPlus Co-simulation Toolbox

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0