How to make Linear Interpolation

7 ビュー (過去 30 日間)
Flashbond
Flashbond 2013 年 8 月 23 日
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?

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 8 月 23 日
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 件のコメント
Flashbond
Flashbond 2013 年 8 月 23 日
編集済み: Flashbond 2013 年 8 月 23 日
Thanks! One more thing; Also I have a Z2 humidity.
Zh = [40.8,41.1,41.4;40.7,41,41.6;40.7,41.1,41.3]
Is it possible to make humidity is the height of suface plot and temperature are the colors? Or Should it be another question in the forum?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by