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?
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 Exchange에서 Line 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