Implicit plane curve discretization

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!

 採用された回答

Matt J
Matt J 2021 年 4 月 16 日
編集済み: Matt J 2021 年 4 月 16 日

3 投票

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 件のコメント

Maxim Bogdan
Maxim Bogdan 2021 年 4 月 17 日
Thanks for the good answer!
But is it possible to get only the points and not the graphic?
Walter Roberson
Walter Roberson 2021 年 4 月 17 日
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 2021 年 4 月 17 日
That works fine for me!
It doesn't open any figure that code for me.
Thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2021 年 4 月 16 日

コメント済み:

2021 年 4 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by