why do I get a strange result with griddata cubic?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Valeria Leto
il 26 Lug 2021
Commentato: Valeria Leto
il 30 Lug 2021
Hi! I used the griddata cubic interpolation for the values of an image. I get this image that has a much higher range, from -300 to 400 aproximately. The non processed image has a range from 90 to 130. Any ideas why this happens?Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/695794/image.png)
3 Commenti
Matt J
il 27 Lug 2021
The code you've posted does not run, I'm afraid:
Unrecognized function or variable 'x'.
Error in test (line 12)
vq_4 = griddata(x,y,C,xq,yq,'cubic');
Risposta accettata
Walter Roberson
il 27 Lug 2021
This is expected behavior when there are sharp edges, especially with a surrounding flat area.
B--
|
-A-
Especially if the region near B is dense, but the edge itself is sparse, then the polynomial generated near the edge needs to mathematically dip down below the base in order to gain the necessary steepness to match the flat control points to the left together with the high points to the right. Polynomials cannot just suddenly rise steeply without a leading edge, so the math needs to insert a downward edge to be able to rise from.
9 Commenti
Bruno Luong
il 30 Lug 2021
working with xs/ys instead of x/y
xs = sx*x
ys = sy*y
sx, sy are appropriate scaling factors that you have to figure it out.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!