draw an Ellipsoid given its quaderatic equation in Matlab How can I draw an ellipsoid in Matlab with following equation:

$aX^2 + bY^2 + cZ^2 + d XY+e XZ +f YZ +gX +hY+iZ=R^2$

with (for example) 
$a=1;
b=2;
c=3;
d=4;
e=5;
f=6;
g=7;
h=8;
i=9;
R^2=10.$
Since the question's been bumped by the Community bot yet again, I'm posting my comment as an answer:

You can just use isosurface.

[X, Y, Z] = meshgrid(-5:5, -5:5, -5:5);
isosurface(X, Y, Z, a*X.^2 + b*Y.^2 + c*Z.^2 + d*X.*Y + e*X.*Z + f*Y.*Z + g*X + h*Y + i*Z, r^2)
You can treat the ellipsoid as a transformed sphere, with points $v$ given by an equation of the form $v^t M v = 1$. Because the matrix $M$ will turn out to be symmetric with nonnegative eigenvalues, it has a square root, say $S$, so that $S^t S = M$. Then the equation becomes $v^t S^t S v = 1$, so $Sv$ is a vector $u$ satisfying $u^t u = 1$, i.e., a point of the unit sphere. Letting $v = S^{-1}u$, you're done. here's the code:

function ellipsoid(a, b, c, d, e, f, g, h, j, R)
M = (1/R^2) * [
    a d e g;
    0 b f h;
    0 0 c j;
    0 0 0 1];
M = (M + M')/2;
S = M^0.5

n = 30;
[th, ph] = meshgrid(linspace(0, 2*pi, n), linspace(0, pi, n));
spherepoints = zeros(4, n, n);
spherepoints(1, :,:) = cos(th) .* sin(ph);
spherepoints(2, :,:) = sin(th) .* sin(ph);
spherepoints(3, :,:) = cos(ph);
spherepoints(4, :, :) = 1;
sp = reshape(spherepoints, 4, []); 
epoints = S \ sp;
epoints = reshape(epoints, 4, n, n);

surf(squeeze(epoints(1, :,:)),...
    squeeze(epoints(2,:,:)),...
    squeeze(epoints(3,:,:)));
set(gca, 'DataAspectRatio', [1,1,1]);
figure(gcf);


Thanks to the anonymous reviewer who noted that I'd written epoints = S * sp instead of S \ sp.