I want to evaluate f[x,y]=-4 x + x^2 - 4 y - y^2 at points (1,-2); (2,-3); (3,-2); (2,-1).
I tried using Outer but for some reason it does not give me actual values. Help.
Remember that Mathematica has a specific way of defining functions. In your case it would be f[x_,y_]:=-4 x + x^2 - 4 y - y^2
. Then you could simply use f[1,-2]
etc.
Perhaps consider using a 'pure' function. For example:
-4 #1 + #1^2 - 4*#2 - #2^2 & @@@ {{1, -2}, {2, -3}, {3, -2}, {2, -1}}
gives
{1, -1, 1, -1}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With