How to make Linear Interpolation
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a room 12x12m². I placed data loggers in every 3 meters in order to measure temperature. Here the matrix I prepared:

How can I fill the zero values with linear interpolation to simulate room's representational view in surf plot?
0 commentaires
Réponse acceptée
Shashank Prasanna
le 23 Août 2013
I am assuming you are using a version of MATLAB atleast after R2012a. If not you can repeat the similar exercize using meshgrid and interp2.
% Actual Data
Z = [24.6,24.4,24;24.7,24.3,24;24.6,24.1,23.9]
[X,Y] = ndgrid([3,6,9],[3,6,9]);
% Interpolation
F = griddedInterpolant(X,Y,Z,'linear');
[Xnew,Ynew] = ndgrid(1:11,1:11);
Znew = F(Xnew,Ynew)
surf(Xnew,Ynew,Znew)
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!