- Parametrize an ellipse with a vector x, whose components represent the eccentricity, size, and center (4 dimensions), or any other parametrization you like.
- Figure out how you can tell whether, for a given x vector, the ellipse is inside the region. In other words, create a function c(x) that is negative when the entire ellipse is in the region, and is positive when some of the ellipse sticks out of the region, and is smooth.
- Write the objective function as negative the area of the ellipse, and the nonlinear inequality constraint is c(x).
- Call fmincon from a variety of initial values.
Fit an ellipse to a set of boxes.
1 次查看(过去 30 天)
显示 更早的评论
I have a set of boxes derived from a text file. These boxes are plotted using the patch command, in the following figure:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152574/image.png)
Now I would like to fit the biggest ellipse possible, inside this set. What is the best way to do so? FYI: The text file contains the vertices of each small box.
0 个评论
回答(1 个)
Alan Weiss
2015-12-11
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!