Implicit plane curve discretization

2 vues (au cours des 30 derniers jours)
Maxim Bogdan
Maxim Bogdan le 16 Avr 2021
Commenté : Maxim Bogdan le 17 Avr 2021
I want to have a matrix with 2 lines and n columns with the coordinates of points that lie on the implicit curve where is a function. I know that the matlab function fimplicit can plot the curve. So in its subroutines it grabs a set of points from\near that curve. How can I extract those points and use them for future calculations (like the perimeter of the curve)?
Thanks!

Réponse acceptée

Matt J
Matt J le 16 Avr 2021
Modifié(e) : Matt J le 16 Avr 2021
fp=fimplicit(@(x,y) x.^2 + 2*y.^2 - 1); %Example
Points=[fp.XData;fp.YData]
Points = 2×587
-0.0458 -0.0533 -0.0667 -0.0800 -0.0933 -0.1067 -0.1200 -0.1333 -0.1467 -0.1600 -0.1689 -0.1733 -0.1867 -0.2000 -0.2133 -0.2267 -0.2337 -0.2400 -0.2533 -0.2667 -0.2800 -0.2834 -0.2933 -0.3067 -0.3200 -0.3251 -0.3333 -0.3467 -0.3600 -0.3616 -0.7063 -0.7061 -0.7055 -0.7048 -0.7040 -0.7031 -0.7020 -0.7008 -0.6994 -0.6980 -0.6969 -0.6964 -0.6947 -0.6928 -0.6908 -0.6887 -0.6875 -0.6864 -0.6840 -0.6815 -0.6788 -0.6781 -0.6760 -0.6730 -0.6699 -0.6687 -0.6667 -0.6632 -0.6597 -0.6593
  3 commentaires
Walter Roberson
Walter Roberson le 17 Avr 2021
fp = fimplicit(@(x,y) x.^2 + 2*y.^2 - 1, 'visible', 'off'); %Example
Points = [fp.XData;fp.YData]
delete(fp)
However this creates a graphic object -- so for example if you have no existing figure then one will be created with an axes in it (that just will not have any visible content.)
Maxim Bogdan
Maxim Bogdan le 17 Avr 2021
That works fine for me!
It doesn't open any figure that code for me.
Thanks a lot!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by