how to plot quadratic equation with 2 variable
    8 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Md Muzakkir Quamar
 il 14 Ott 2020
  
    
    
    
    
    Risposto: Ameer Hamza
      
      
 il 14 Ott 2020
            f(x,y)= 1/2*x^2 +  x*y + y^2 + y
i tried plotting using Fimplicit function but i am getting some error. copied below
______________________________________

>>  fimplicit3(@(x,y) 1/2*x.^2+ x*y+ y.^2+y)
Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to
return an output with the same size and shape as the input arguments. 
> In matlab.graphics.function.ImplicitFunctionSurface>getFunction
  In matlab.graphics.function.ImplicitFunctionSurface/updateFunction
  In matlab.graphics.function.ImplicitFunctionSurface/set.Function
  In matlab.graphics.function.ImplicitFunctionSurface
  In fimplicit3>singleFimplicit (line 184)
  In fimplicit3>@(f)singleFimplicit(cax,f,limits,extraOpts,args) (line 146)
  In fimplicit3>vectorizeFimplicit (line 146)
  In fimplicit3 (line 120) 
________________________________________
Also ince this is quadratic equation i was expecting a concave or convex figure but i am getting a cylindrical image.
can anyone explain...??
0 Commenti
Risposta accettata
  Ameer Hamza
      
      
 il 14 Ott 2020
        You need to use fsurf() and use element-wise operators in your function handle
fsurf(@(x, y) 1./2*x.^2+ x.*y+ y.^2+y)
0 Commenti
Più risposte (1)
  KSSV
      
      
 il 14 Ott 2020
        x = linspace(0,1) ;
y = linspace(0,1) ;
[X,Y] = meshgrid(x,y) ; 
f =  1/2*X.^2 +  X.*Y + Y.^2 + Y ;
surf(X,Y,f)
0 Commenti
Vedere anche
Categorie
				Scopri di più su Numerical Integration and Differential Equations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


