Finding angles with optimizaiton
显示 更早的评论
Hello,
I am new to Matlab and would like to find the closest angles to this relationship

How can I do this with the optimization tools in matlab?
Best Regards
回答(1 个)
Ameer Hamza
2020-12-8
编辑:Ameer Hamza
2020-12-8
You need at least two equations to find a unique solution. For a single equation, fix the value of one of these variables
theta = 0.5;
fun = @(phi) sin(theta)^2*cos(phi)^2;
phi = fsolve(fun, rand())
类别
在 帮助中心 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!