Utilising Walters suggested syntax, the expected code in MATLAB is:
f_1 = (abs(location.x) <= abs(location.y)).*sign(location.y);
f_2 = (abs(location.y) <= abs(location.x)).*sign(location.x);
f(1,:) = A.*f_1;
f(2,:) = -A.*f_2;
f(3,:) = 0;
As mentioned in my initial post, I'm not sure why I require two functions in MATLAB, but the writer in mathematica could achieve the same thing with a single function - if anyone can manage this it would be nice to have, but is unimportant in general.
Best Answer