For loop for and equations in two variable.
2 次查看(过去 30 天)
显示 更早的评论
I am preparing a code regarding to solve three equation that depend on two same variables and want to have all the positive roots for all the three equations.
t1=input('left end point of domain');
t2=input('right end point of domain');
c=input('increment of domain');
for a=t1:c:t2
for b=t1:c:t2
d=15*a^6 + 45*a^4*b^2 + 64*a^3*b^3 + 45*a^2*b^4 + 15*b^6 - ...
64*sqrt(a^2+b^2)*(a^5 + a^3*b^2 + a^2*b^3 + b^5);
m = (4*(a^2+b^2)^(3/2)*(-8*a^3+8*a^3*b^3 + ...
sqrt(a^2+b^2)*(a^2+7*a^5+b^2+7*a^3*b^2-8*a^2*b^3-8*b^5)))/d;
mt= -((4*(a^2+b^2)*(8*a^7+16*a^5*b^2-a^4*(1+7*b^3)) - ...
2*a^2*(b^2+7*b^5)-b^3*(b+7*b^4-8*sqrt(a^2+b^2)) + ...
8*a^3*b^3*(b-sqrt(a^2+b^2)))/d);
m0= 1 - (2* ((4* (a^2 + b^2)^(3/2)*(-8* a^3 + 8 *a^3* b^3 + sqrt(a^2 + b^2)*(a^2 + 7* a^5 + b^2 + 7* a^3 *b^2 - 8* a^2* b^3 - 8* b^5)))/d) - (4* (a^2 + b^2)* (8* a^7 + 16 *a^5 *b^2-a^4*(1 + 7* b^3)-2 *a^2 *(b^2 + 7* b^5) - b^3* (b + 7* b^4 - 8* sqrt(a^2 + b^2)) + 8* a^3 *b^3* (b - sqrt(a^2 + b^2))))/d);
end
end
regards
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!