How to make contour plot from this function in MATLAB R2013a?
Mostrar comentarios más antiguos
f(x,y)= x^5 + x^4- 2x^2 y + y^2
Respuestas (1)
KSSV
el 9 de Abr. de 2018
f = @(x,y) x.^5 + x.^4- 2*x.^2.*y + y.^2 ;
N = 100 ;
x = linspace(0,1,N) ;
y = linspace(0,1,N) ;
[X,Y] = meshgrid(x,y) ;
Z = f(X,Y) ;
contour(X,Y,Z,100)
5 comentarios
Brigitte Trista Indah Yudhiana Sutrisno
el 9 de Abr. de 2018
KSSV
el 9 de Abr. de 2018
To get the function solved, you need to have x,y values. (0,1) is the range of x and y I gave. N = 100, it divides (0,1) interval into 100 points. Read about linspace.
Brigitte Trista Indah Yudhiana Sutrisno
el 9 de Abr. de 2018
KSSV
el 9 de Abr. de 2018
Where is the error? The given code works fine. Show us the code, if you have made any changes.
Brigitte Trista Indah Yudhiana Sutrisno
el 9 de Abr. de 2018
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!