MATLAB: How to graph a quadratic function f(x,y) – parabola functiongraphMATLABparabolaplotquadratic The intention is to plot the next equation: 0==-(x+y).^2+6540.*(y.*2.6284 – x.*2.187) and get the following parabola: I've tried several options, but I'm not able to get the parabola, what could I do? Best Answer Starting in R2016b, https://www.mathworks.com/help/matlab/ref/fimplicit.htmlf = @(x,y) (x+y).^2 + 6540 * (y * 2.6284 - x * 2.187);fimplicit(f, [-5000, 20000, -20000, 5000]) Related SolutionsMATLAB: How can i represent 2 functions on the same graph One option is the fimplicit (link) function:f1 = @(x,y) 2*x.^3-5*x-2*y.^3+1;f2 = @(x,y) x.^4+4*y.^4.*y-6;figure(1)fimplicit(f1, [-10 10 -10 10])hold onfimplicit(f2, [-10 10 -10 10])hold offlegend('f_1(x,y)', 'f_2(x,y)', 'Location','NW') MATLAB: Plotting a surface in MATLAB You need to use the meshgrid (or equivalently, ndgrid) function:x = linspace(-1, 1);y = linspace(-2, 2);[X,Y] = meshgrid(x,y);f = @(x,y) x.^2.*y./(x.^2 + y.^2);figure(1)surf(X,Y,f(X,Y))grid onI created a function for ‘f’ here, but you could as easily use it simply as:f = X.^2.*Y./(X.^2 + Y.^2);and then plot as:plot(X,Y,f)I ‘vectorised’ your code to do element-wise operations. See the documentation on Array vs. Matrix Operations for a full discussion. Related QuestionHow to plot itHow to plot quadratic equation with 2 variableX^2*y^3+2*x+2*exp(4*y)-1=0How to plot (x,y) subjected to any function.
Best Answer