As the title says I am setting a property with the constructor and would like to access the property later as a get function that is static. How would I do this in MATLAB?
classdef Wrapper
properties(Access=public)
dataStruct
end
methods
function data = Wrapper(filePath)
if nargin == 1
data.dataStruct=load(filePath)
end
end
end
methods(Static)
function platPosition = getPlatPosition()
platPosition = dataStruct.someField
end
end
end
--------------------------
import pkg.Wrapper.*
test = Wrapper('sim.mat')
pos = test.getPlatPosition