MATLAB: How to plot a 2d potential function

2d plotsMATLABpotential functions

Hi all. Today I came across a function f(X,Y) = cos(2*pi*X)(1+3Y) + ((2*pi*y)^2)/2.
I thought this was a 3d function but apparently it's not. How do i plot this 2D function in MATLAB.
Is there a special function for handling potential functions in MATLAB? thank you very much

Best Answer

f = @(X,Y) cos(2*pi.*X).*(1+3.*Y) + ((2*pi.*Y).^2)/2
fsurf(f)
func_sirf.PNG
Related Question