inpolygon, different results from MATLAB R2022a and R2023a?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Dyuman Joshi
le 12 Déc 2023
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
le 12 Déc 2023
Modifié(e) : Adam Danz
le 12 Déc 2023
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
Réponses (1)
Cris LaPierre
le 12 Déc 2023
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 commentaires
Matt J
le 13 Déc 2023
@Junichiro Kawahara Please Accept-click Cris' answer, seeing as you are happy with it.
DGM
le 13 Déc 2023
Ah. I didn't even expect that to be a thing. That kind of makes the other bug report make more sense now.
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!