interpolating Sample data to finer increment

2 ビュー (過去 30 日間)
Michael
Michael 2018 年 1 月 16 日
コメント済み: Thorsten 2018 年 1 月 18 日
Hello,
What I have is a 3D set of point X, Y and Z(Weights) and I want to be able to interpolate the Z data to finer intervals in the X and Y direction. Say X from -17.5, 17.5 in 0.5 steps and Y 15 to -15 in 0.25 step.
------- Zone -17.5 0 17.5 15 0.6 0.8 0.6 0 0.7 1 0.7 15 0.6 0.8 0.6 -------
[Weights] = [0.6 0.8 0.6; 0.7 1.0 0.7; 0.6 0.8 0.6];
[X] = [-17.5,0,17.5];
[Y] = [-15, 0, 15];
figure
surf(X,Y,Weights)
title('Original Sampling');

採用された回答

Thorsten
Thorsten 2018 年 1 月 17 日
Vq = interp2(X,Y',Weights, -17.5:0.5:17.5, (-15:0.25:15)');

その他の回答 (1 件)

Michael
Michael 2018 年 1 月 17 日
Thanks
Both of the following lines did solve my issue; however, I am not sure what the ' does, In this example exactly what does the prime symbol ' achieve?
Vq = interp2(X,Y,Weights, -17.5:0.5:17.5, (-15:0.25:15)', 'cubic'); Vq = interp2(X,Y,Weights', -17.5:0.5:17.5, (-15:0.25:15)', 'cubic');
  1 件のコメント
Thorsten
Thorsten 2018 年 1 月 18 日
The ' transposes the vector from a row to a column vector. From the help of interp2:
Xq can be a row vector, in which case it specifies a matrix with
constant columns. Similarly, Yq can be a column vector and it
specifies a matrix with constant rows.
Not that if you transpose your Weights you will have a different solution.

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

カテゴリ

Find more on Interpolation in Help Center and File Exchange

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by