Handle class property inheriting value methods
1 view (last 30 days)
Show older comments
Is there any way to create a handle class with the functionality of a value class, such that calling builtin methods of value classes would operate on a given Property? For example, let's say you have the class DataArray
classdef DataArray < handle
function obj = DataArray(Value,Unit)
obj.Value = Value;
obj.Unit = Unit;
It would be very convenient to tell Matlab that any value methods (e.g. max, min, std...) should be applied to obj.Value without needing to explicitly define each method. Is there any way to accomplish this?
Find more on Construct and Work with Object Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!