Hello Marco,
I noticed an issue in your code when reviewing it. Specifically, the line:
f=@(x,y,z,w)arrayfun(func,x,y,z,w);
is causing an error. When passing a function as an argument to another function, you need to use the @ symbol to indicate that it is a function handle. Here's an example for your reference from the Mathworks documentation page: https://in.mathworks.com/help/matlab/matlab_prog/pass-a-function-to-another-function.html#:~:text=b%20%3D%205%3B%0Aq1%20%3D-,integral(%40log%2Ca%2Cb),-q1%20%3D%203.0472
To correct your code, you should update the line to:
f=@(x,y,z,w)arrayfun(@func,x,y,z,w);
Implement this fix, and your code should work as expected. This is the output after executing updated code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1617888/image.png)