3D surface with 1800000 points
5 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
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.
More Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!