inpolygon, different results from MATLAB R2022a and R2023a?

4 vues (au cours des 30 derniers jours)
Junichiro Kawahara
Junichiro Kawahara le 12 Déc 2023
Commenté : DGM le 13 Déc 2023
aoi1_x = [0, 960];
aoi1_y = [0, 1080];
inpolygon(2, 2, aoi1_x, aoi1_y)
ans = logical
0
R2022a returns 1, but R2023a returns 0.
I would like to know why these results differ.
  6 commentaires
Dyuman Joshi
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
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.

Connectez-vous pour commenter.

Réponses (1)

Cris LaPierre
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
Matt J le 13 Déc 2023
@Junichiro Kawahara Please Accept-click Cris' answer, seeing as you are happy with it.
DGM
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by