Pase la variable por referencia a la función en MATLAB
classdef myClass < handle
properties
data
end
methods
function h = myClass(data)
h.data = data ;
end
end
end
% Then defining a function (which could be a method) like
function myFunction(h)
h.data = h.data+2;
end
% lets you do something like
h = myClass(0);
myFunction(h);
h.data
ans =
2
Tiny Coders