Try this:
a = double(subs(a)); b = double(subs(b)); c = double(subs(c));
Like here:
[x,y] = meshgrid(-3:1:3);
z = 1.5*x - 3;
mesh(x,y,z);
p = -1.5*pi;
q = -pi/2;
r = 0;
for i = 1:1:10
pause(0.1);
p = p + (0.0173*5);
q = q + (0.0173*5);
r = r + (0.0173*5);
a1 = 3*cos(p); b1 = 3*sin(p); c1 = -3;
a2 = 3*cos(q); b2 = 3*sin(q); c2 = -3;
a3 = 2*cos(r); b3 = 2*sin(r); c3 = 0;
syms a b c d
eq1 = 'a1*a + b1*b +c1*c -d =0';
eq2 = 'a2*a + b2*b + c2*c -d=0';
eq3 = 'a3*a + b3*b +c3*c -d =0';
[a,b,c] = solve(eq1,eq2,eq3,'a,b,c');
a = a/d;b = b/d; c = c/d;
a = double(subs(a)); b = double(subs(b)); c = double(subs(c));
disp(a);disp(b);disp(c);
z = -(a*x + b*y)/c;
mesh(x,y,z);
end
Please note that I renamed one of your b1 to b2.
Best Answer