Get a value of non existant index of array by interpolation

11 ビュー (過去 30 日間)
CLEBER ALBERT
CLEBER ALBERT 2016 年 9 月 3 日
回答済み: Star Strider 2016 年 9 月 3 日
Im trying to remember a function in Matlab which returns a value of non existant index of array by interpolation.
eg:
arry = [4 5 6];
index = 1.5;
suchfunction(arry,index) %should return a value between the index 1 and 2 by interpolation (would be 4.5)
ans = 4.5
Could someone help me!?

採用された回答

Star Strider
Star Strider 2016 年 9 月 3 日
Use the interp1 function:
arry = [4 5 6];
idx = 1:3;
idxi = 1.5;
arryi = interp1(idx, arry, idxi)
arryi =
4.5

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by