How do I set F.ExtrapolationMethod to 'none' in function 'griddedInterpolant'?
7 ビュー (過去 30 日間)
古いコメントを表示
Function: griddedInterpolant Q: How/where do I do set F.ExtrapolationMethod to 'none'?
"The behavior of griddedInterpolant has changed. All interpolation methods now support extrapolation by default. Set F.ExtrapolationMethod to 'none' to preserve the pre-R2013a behavior when F.Method is 'linear', 'cubic' or 'nearest'. Before R2013a, evaluation returned NaN values at query points outside the domain when F.Method was set to 'linear', 'cubic' or 'nearest'."
0 件のコメント
採用された回答
Stephen23
2017 年 5 月 3 日
編集済み: Stephen23
2017 年 5 月 3 日
The griddedInterpolant documentation shows that the extrapolation can be specified by the last argument, after the interpolation method:
F = griddedInterpolant(___,Method,ExtrapolationMethod)
so you will need something like this:
F = griddedInterpolant(___,'linear','none')
Alternatively try changing the object property:
F.ExtrapolationMethod = 'none';
2 件のコメント
Steven Lord
2017 年 5 月 3 日
That's a different problem, not related to the ExtrapolationMethod. That suggests to me that the values in depth_act(:, j) are not unique for some j. Set an error breakpoint and when MATLAB enters debug mode, check:
length(depth_act(:, j))
length(unique(depth_act(:, j)))
My guess is that the two lengths will be different.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!