inpolygon, different results from MATLAB R2022a and R2023a?
4 次查看(过去 30 天)
显示 更早的评论
aoi1_x = [0, 960];
aoi1_y = [0, 1080];
inpolygon(2, 2, aoi1_x, aoi1_y)
R2022a returns 1, but R2023a returns 0.
I would like to know why these results differ.
6 个评论
Dyuman Joshi
2023-12-12
I disagree. It's frustrating to know that a well known* bug is not even acknowleged by TMW, nor is there any acknowlegment of the bug being fixed for the later versions.
And the fact that it is still not fixed for the versions mentioned, just adds onto the frustration.
* - I say well known because it appears across multiple versions.
Adam Danz
2023-12-12
编辑:Adam Danz
2023-12-12
To confirm what others have mentioned above, this behavior was updated in R2022b.
A bug report was not published.
For FAQs on bug reports, see https://www.mathworks.com/support/bug_reports/faq.html
回答(1 个)
Cris LaPierre
2023-12-12
This is not an official MathWorks answer.
My observation is the following. You used to be able to define a rectangular ROI by specifying just 2 diagonal vertices. However, this behavior was undocumented. All doc examples and wording indicate you should specify all vertices. Apparently around R2022b, changes were made to the function that no longer allow you to specify a rectangular ROI with just 2 points.
This example highlights the risk of using undocumented behavior - it can change at any time without notice.
3 个评论
Matt J
2023-12-13
@Junichiro Kawahara Please Accept-click Cris' answer, seeing as you are happy with it.
DGM
2023-12-13
Ah. I didn't even expect that to be a thing. That kind of makes the other bug report make more sense now.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!