How to plot a 2d potential function
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MatlabEnthusiast
el 27 de Feb. de 2019
Comentada: MatlabEnthusiast
el 27 de Feb. de 2019
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
0 comentarios
Respuesta aceptada
Stephan
el 27 de Feb. de 2019
Editada: Stephan
el 27 de Feb. de 2019
f = @(X,Y) cos(2*pi.*X).*(1+3.*Y) + ((2*pi.*Y).^2)/2
fsurf(f)
3 comentarios
Stephan
el 27 de Feb. de 2019
Editada: Stephan
el 27 de Feb. de 2019
Yes, you have independent 2 input variables and a resulting value which is usually shown in the 3rd dimension. But of course you also can show this in 2D by using:
fcontour(f)
This results in:
If this answer was helpful, please accept it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!