interpolation
1 回表示 (過去 30 日間)
古いコメントを表示
hello I have two sets of data one is natural and the other is from experiment, the first is bigger than the second and more dense each data type have (t,x,y) how can I interpolate the data from the experiment using all of data vectors (t,x,y)? I want to calculate the error between the two thanks By the way i tried interp with no success I think I need to use amshgrid but I dont know ho to use it
0 件のコメント
回答 (3 件)
Aaditya Kalsi
2012 年 4 月 1 日
This is an easy one.
Let's say you have non-uniformly sampled data t, x, y. You want to find uniformly distributed values for these now.
I am assuming that t = f(x, y).
First we can define the the uniform grid we want the answers on. This usually would be like:
x = rand(100, 1);
y = rand(100, 1);
t = (x + y).^2;
% spacing
divUnit = 0.01;
xUnif = min(x) : divUnit : max(x);
yUnif = min(y) : divUnit : max(y);
% obtain the regural grid by MESHGRIDing the regularly spaced vectors
[X, Y] = meshgrid(xUnif, yUnif);
% interpolate 't' on this uniform grid
intObj = TriScatteredInterp(x, y, t);
T = intObj(X, Y);
% plot what we have
figure;
scatter3(x, y, t);
hold on;
surf(X, Y, T);
0 件のコメント
Aaditya Kalsi
2012 年 4 月 1 日
If you want to find the error between the two, you might be better of finding a model to predict this 'data' and then use Statistics to figure out how confidently your model fits each dataset. That would be the best way. The interpolation above may not be what you're looking for. For information on what Interpolation is performed here try:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!