3D surface with 1800000 points

5 views (last 30 days)
Andreas
Andreas on 29 Dec 2011
Hi,
as you probably see already in the title this is my first real experience with matlab. :)
I do have a plenty of points from a measurement. If I run the normal 3D plot operation meshgrid like:
x=1:1:3600;
y=1:1:500;
z=[1.10957e-005 2.2775e005 0.0000000000 0.000000000 ............];
[x,y]=meshgrid(x,y);
colormap(jet);
surf(x,y,z);
I do get a pretty a bad picture with many peaks and a lot of 'noise. My question is how can I avoid or better rewrite this noise to get a smooth surface. May be I can edit the matrix somehow like for 1.0e-005<x<3.0e-005 do x=((x-1)+(x+1))/2 or something
As preveously mentioned I am not a pro in programming, so if anybody please could help me, it would be great.
Many Thanks in advance!
Andreas

Accepted Answer

John D'Errico
John D'Errico on 29 Dec 2011
There are a couple of easy solutions.
1. You could use my gridfit, with the x,y,z as input and an appropriate choice of smoothing constant to do some smoothing, but not too much smoothing to lose the signal.
2. You can use conv2, with a (truncated) Gaussian shaped kernel to do the smoothing - a Gaussian blur. Pick some width for the Gaussian that works, not doing too much blurring, but enough to smooth out the noise acceptably.
Either solution is acceptable, and CAN produce reasonable results, but you will need to play with it to decide on how much smoothing/blurring is appropriate for your problem. That depends on how much noise you have, and how badly you need it smooth. Of the two, conv2 will be considerably faster here, but gridfit will take less thought to get it working.
  1 Comment
Andreas
Andreas on 6 Jan 2012
Hi John, thanks for the help.
I've just tried griddata but got the error 'X and Y must be same size or vectors of different orientations'
For gridfit I do get the error that the gridfit is not suitable for double
conv2 is something I do not really understand, except that I need an orhtogonal mtrix, which in my case is not given:
x=3600
y=500
Any help on that?
Thanks in advance.
Andreas

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!