필터 지우기
필터 지우기

Surface Fitting only in Z Direction

조회 수: 2 (최근 30일)
Jasnoor Singh
Jasnoor Singh 2016년 5월 19일
댓글: Jasnoor Singh 2016년 5월 19일
I have a 44 by 44 square grid and I have a pressure value specified in the Z direction at each intersection point in the grid. So basically 44 x 44 = 1936 pressure values. I am able to plot a surface for these pressure values but the surface has many peaks. In what way can I smooth the surface? I cannot use cftool since I need to do this for multiple grids. How can I do this automatically by writing a code? I tried using the following syntax:
fitobject = fit([x,y],z,fitType)
But I only want to smooth the surface in Z direction, x and y are distances in space and hence need to be constant. How can I do this?

답변 (1개)

John D'Errico
John D'Errico 2016년 5월 19일
But you just have a regular grid in x,y. So just use conv2, with a Gaussian blur kernel. Simple to do. Fast. Easy. No need to do any curve or surface fitting.
  댓글 수: 1
Jasnoor Singh
Jasnoor Singh 2016년 5월 19일
I'm not very familiar with the functions of matlab since I am new to the software. Could you please tell me how to use this function?
For your reference, following is my code so far:
x = 1:44;
y = 1:44;
for i = 1:5
a = xlsread('\\uoa.auckland.ac.nz\engdfs\air.xlsx',strcat('CO',int2str(46*i-18),':','EF',int2str(46*i+25)));
figure;
surf(x,y,a);
axis([0 44 0 44 -50 120]);
fname = sprintf('A%d.png',i);
saveas(gcf,fname);
end

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by