I would like to update the RMS object property always when the signal object property has change:
classdef track < handle properties rms = 0; end properties (SetObservable) signal = [1 2 3 4 5 6 7 8 9 10]; end methods function obj = update_rms(obj) obj.rms = rms(obj.signal); end endend
I don't understand very well the Matlab link: https://www.mathworks.com/help/matlab/matlab_oop/listening-for-changes-to-property-values.html#brkimdj-1
EXAMPLE:
% Init object:
myObj = track();% Signal property manual update:
myObj.signal = [1 1 1 1];% After this, I would like that myObj update automatically the RMS property calling the update_rms method.
Could you help me?
Best Answer