StringCustomDisplay - GavriYashar/Matlab-Utilities GitHub Wiki
usage example
classdef MyClass < handle & StringCustomDisplay
properties (SetAccess = public) % private
prop1(1,1) string = ""
end
methods (Access = public)
function obj = MyClass()
obj.prop1 = char(randi(26,[1,15]) + 65);
end
function p1 = getProp1(objs)
p1 = MyClass.reshapeT(objs, [objs.prop1]);
end
function str = string(objs)
str = class(objs) + "[prop1=""" + objs.getProp1() + """]";
end
end
methods (Static = true)
function T = reshapeT(objs, T)
% e.g.: objs == goodOldSP.messstelle.Messstelle
% messobjekt = handleDA.reshapeT(objs, [objs.Messobjekt]);
T = reshape(T, size(objs));
end
end
end
mc(2,3) = MyClass();
for i = 1:numel(mc)
mc(i) = MyClass();
end
mc =
2×3 MyClass array:
(1,1) ⇥ MyClass[prop1="OVZEPNBJFVJOFQH"]
(2,1) ⇥ MyClass[prop1="SSUMDGYEWO[DMD["]
(1,2) ⇥ MyClass[prop1="BVWXDLHVMYFHEEX"]
(2,2) ⇥ MyClass[prop1="QPEXRKOLCHEFHLC"]
(1,3) ⇥ MyClass[prop1="YZNNJYKDVLHLDEZ"]
(2,3) ⇥ MyClass[prop1="ZPCHKWBCFRURMPI"]
Methods, Events, Superclasses, show-details, edit-Class, documentation
% Superclass List
MyClass:
(1,1) ⇥ MyClass[prop1="ELYVZSBXZSUULSF"]
Superclasses for class classString:
"handle edit-Class documentation"
"StringCustomDisplay edit-Class documentation"
"matlab.mixin.CustomDisplay edit-Class documentation"