How do I smooth a curve on a surf plot?

조회 수: 2 (최근 30일)
Andrew Stark
Andrew Stark 2022년 3월 20일
댓글: Andrew Stark 2022년 3월 20일
I have been trying to "smooth" out this curve in MATLAB but have been unable to. The goal is to have a smoother curve depicted in this surf plot. Any ideas?
I have attached the code needed to make the figure to and I used the code below to generate this figure
surf(ZFF_vals, DFF_vals, Fin

답변 (2개)

KSSV
KSSV 2022년 3월 20일
surf(ZFF_vals, DFF_vals, Fin)
shading interp
  댓글 수: 1
Andrew Stark
Andrew Stark 2022년 3월 20일
I think even with the shading, the data still looks rough. I was looking for something that more of alters the data, that way the curve isnt as rough. I am trying to alter this data so that it becomes a smooth curve.

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


Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 3월 20일
You can try smoothdata() with Gaussian, e.g.:
X = load('DFF_vals.mat');
Y = load('ZFF_vals.mat');
Z = load('Fin.mat');
Zsmooth = smoothdata(Z, 'gaussian', 25);
subplot(211)
mesh(X,Y,Z)
subplot(212)
mesh(X,Y, Zsmooth), view([30, 45, 30])
  댓글 수: 1
Andrew Stark
Andrew Stark 2022년 3월 20일
Thanks for responding. I was looking for something that more of alters the data, that way the curve isnt as rough. Something that maybe gets rid of the outliers and introduces new data points where the curve is if that makes sense.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by