How to fit a smooth curve inside an edge while plotting a 2D figure

조회 수: 3 (최근 30일)
Nithin
Nithin 2017년 1월 3일
편집: Nithin 2017년 1월 4일
Hi,
I have a 2D plot with an edge, I would like to remove the edge as shown in the figure attached and replace with a smooth curve inside (red curve). Could someone provide a good solution.
thanks.

답변 (1개)

Image Analyst
Image Analyst 2017년 1월 3일
You can smooth the y values:
ySmoothed = conv(y, ones(1, 51), 'same');
Change the 51 depending on whether you want more or less smoothing, but keep it an odd integer.
  댓글 수: 1
Nithin
Nithin 2017년 1월 4일
편집: Nithin 2017년 1월 4일
Hi,
Many thanks for the reply and help. I tried to use it but the shape gets altered.I have attached a text file with few data points (x,y) showing the tear drop shape.
plotted like :
Thanks and much regards.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Smoothing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by