Hi I have a question about how to achieve the following behaviour in Matlab.
A.x=pi
A.sin=@()sin(A.x)
A.sin() % Returns 1.2246e-16, essentially 0 so all good so far.
% Now for the problem
A.x = pi/2
A.sin() % Returns 1.2246e-16, meaning the new A.x is not used. It should return 1.
Does anyone have any ideas how to achieve this. I know I could define A.sin as @(x) sin(x)
then provide A.x but would rather find an alternative.
Thanks.