Meshgrid fo variables in complex equation
15 views (last 30 days)
Show older comments
I have an equation that have three variables
The equation is like this : f(x, y, z)=2x+3y+4z=0
But the equation I really want to use is more complex that I can’t turn it into
z=(-3y-2x)/4 format like this
And I want to draw a plot about the relation between the three(x, y, z) when
x = 3: 1:6; (3,4,5,6)
y = 5: 1:9; (5,6,7,8,9)
I know that if I can turn the equation into z=(-3y-2x)/4 format, I can do that using
x=3:1:6;
y=5:1:9;
[xx,yy]=meshgrid(x,y);
zz=(-3.*yy-2.*xx)/4;
mesh(xx,yy,zz);
But because the equation I really want to use is too complex, I can’t use the method to get the answer I want
I also try the other way using for loop
i=1
for x= 3:1:6
for y= 5:1:9
syms f(z)
f=2*x+3*y+4*z;
answer=solve(f);
answer2(i)=answer;
x1(i)=x;
y1(i)=y;
i=i+1;
end
end
answer3=double(answer2);
[x2,y2]=meshgrid(x1,y1);
But still don’t know the next process
Can I have other methods to use, or can I revise the methods above to solve my problem?
I am new to matlab, and i really need your help, thank you!
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!