I need to smooth a 3d graph
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
this is tha data I have now and i need to smooth it out thank you! there is no errors or red text in the following code
x=1:10;
y=1:21;
z=[0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 -9 0 0 0 0; 0 0 0 0 -5 -7 0 0 0 0; 0 0 -10 -25 -15 -5 0 0 0 0; 0 -20 -32 -46 -27 -7 0 0 0 0; 0 -17 -61 -82 -21 0 0 0 0 0; 0 -12 -28 -52 -30 -12 0 0 0 0; 0 -22 -43 -79 -53 -30 -12 0 0 0; 0 -15 -38 -63 -92 -68 -33 0 0 0; 0 0 -15 -37 -61 -49 -22 0 0 0; 0 0 0 -17 -56 -30 -17 0 0 0; 0 0 0 -15 -56 -30 -17 0 0 0; 0 0 -15 -32 -54 -94 -79 -31 0 0; 0 0 -21 -15 -25 -52 -37 -20 0 0; 0 0 -15 -40 -70 -49 -20 -15 0 0; 0 0 -11 -23 -14 -20 -46 -29 -14 0; 0 0 0 -10 -27 -39 -25 -15 0 0; 0 0 0 -15 -32 -56 -26 -10 0 0; 0 0 0 -10 -17 -25 -15 0 0 0; 0 0 0 0 -20 -10 0 0 0 0; 0 0 0 0 -5 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0];
surf(z);
0 commentaires
Réponses (1)
John D'Errico
le 26 Nov 2022
x=1:10;
y=1:21;
z=[0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 -9 0 0 0 0; 0 0 0 0 -5 -7 0 0 0 0; 0 0 -10 -25 -15 -5 0 0 0 0; 0 -20 -32 -46 -27 -7 0 0 0 0; 0 -17 -61 -82 -21 0 0 0 0 0; 0 -12 -28 -52 -30 -12 0 0 0 0; 0 -22 -43 -79 -53 -30 -12 0 0 0; 0 -15 -38 -63 -92 -68 -33 0 0 0; 0 0 -15 -37 -61 -49 -22 0 0 0; 0 0 0 -17 -56 -30 -17 0 0 0; 0 0 0 -15 -56 -30 -17 0 0 0; 0 0 -15 -32 -54 -94 -79 -31 0 0; 0 0 -21 -15 -25 -52 -37 -20 0 0; 0 0 -15 -40 -70 -49 -20 -15 0 0; 0 0 -11 -23 -14 -20 -46 -29 -14 0; 0 0 0 -10 -27 -39 -25 -15 0 0; 0 0 0 -15 -32 -56 -26 -10 0 0; 0 0 0 -10 -17 -25 -15 0 0 0; 0 0 0 0 -20 -10 0 0 0 0; 0 0 0 0 -5 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0];
surf(z)
Simplest is a convolution based blur. This one is a simple distance weighting:
n = 3;
n2 = (n-1)/2;
[x,y] = meshgrid((1:n) - n2);
K = 1./(1 + sqrt((x - n2).^2 + (y - n2).^2));
K = K/sum(K,'all')
zhat = conv2(K,z)./conv2(ones(size(z)),K);
surf(zhat)
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!