How can I use interp2 or interp3 for data without using MESHGRID or NGRID previously?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have coordinates X, Y, Z each of one is a Matrix of 67 x 147. Each Matrix was no generated by MESHGRID or NGRID method but just were adjusted by means reshape() to be visualize with surf(). However when I try to use interp2() to get a value that I need. There is a error that indicates that data were not generated with meshgrid(). How can I convert the data to interpolate?.
Best Regards
Diego F.
0 commentaires
Réponses (1)
Walter Roberson
le 30 Mai 2013
Interpolation for 2-D gridded data in meshgrid format
ZI = interp2(X,Y,Z,XI,YI) returns matrix ZI containing elements corresponding to the elements of XI and YI and determined by interpolation within the two-dimensional function specified by matrices X, Y, and Z. X and Y must be monotonic, and have the same format ("plaid") as if they were produced by meshgrid.
Are your X and Y matrices monotonic and "plaid" ? So one of them goes like
1 2 3
1 2 3
1 2 3
and the the other one goes like
4 4 4
5 5 5
6 6 6
?
2 commentaires
Walter Roberson
le 30 Mai 2013
Consider using http://www.mathworks.com/help/matlab/ref/triscatteredinterp.html or in newer versions http://www.mathworks.com/help/matlab/ref/scatteredinterpolantclass.html
Voir également
Catégories
En savoir plus sur Interpolation 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!