Is there any more effiecient way to implement this?
古いコメントを表示
Using MATLAB:I have a table of lets say x(size(100x1)),y(size(100x1)) and z(size(100x100)) and i use
z1 = interp2(x,y,z,x1,x2)
to find a scalar value that i need for later calculation. I was wondering if there is a more efficient/quicker way to implement this.scatteredInterpolant function could help? I tried unsuccessfully to implement it with scatteredInterpolant
2 件のコメント
per isakson
2014 年 10 月 18 日
"find a value"   should I understand one scalar value?
Dimitrios
2014 年 10 月 18 日
採用された回答
その他の回答 (1 件)
per isakson
2014 年 10 月 18 日
編集済み: per isakson
2014 年 10 月 18 日
0 投票
If linear is good enough as you indicate in the question (default of interp2).
My approach to a similar performance problem included
- avoid the function call. The call itself takes longer than the computation (of a scalar)
- a few lines of code, which do the interpolation, directly in the "calling" code.
カテゴリ
ヘルプ センター および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!