Given the following matlab code:
A = reshape (1:9 ,[3 3]);
f = @(x) x^2;
f(A)
the output is:
A =
1 4 7
2 5 8
3 6 9
ans =
30 66 102
36 81 126
42 96 150
Can you please explain to me how this output is calculated? how the anonymous function is invoked?
I want to write the same program in python.
Is there any compatible function in python which lets me implement this?