Why is this "z=x.*exp(-X.^2-Y.^2) " required?
15 views (last 30 days)
Walter Roberson on 21 Aug 2021
The z= part is not required. The (-X.^2-Y.^2) part is not required either. However, as long as you have exp() you need to provide some argument to it.
For example, the following would be valid MATLAB code:
However, it does not do anything useful.
I suspect that you are looking for something closer to
[x, y] = meshgrid(-2:.2:2);
z = x .* exp(-x.^2 - y.^2);
surf(x, y, z, 'edgecolor', 'none')
More Answers (0)
Verification, Validation, and Test Requirements Toolbox Requirements Definition Import, Update, and Export Requirements