find the interpolation of two values.
2 ビュー (過去 30 日間)
古いコメントを表示
solleti prabhakarchary
2022 年 10 月 8 日
回答済み: Image Analyst
2022 年 10 月 8 日
how to find values for this data in between
6 1.256 1.365 0.358 2.589 2.365 2.365 2.456
8 3.250 3.255 3.62 1.25 1.256 2.321 3.214
i would like to find values for 6.5, 7, 7.5 using matlab. which command need to be used please help me in this code.
0 件のコメント
採用された回答
Image Analyst
2022 年 10 月 8 日
m = [...
6 1.256 1.365 0.358 2.589 2.365 2.365 2.456
8 3.250 3.255 3.62 1.25 1.256 2.321 3.214];
[rows, columns] = size(m);
m2 = zeros(rows + 3, columns);
for col = 1 : size(m, 2)
m2(:, col) = linspace(m(1, col), m(2, col), 5);
end
m2
0 件のコメント
その他の回答 (1 件)
Ghazwan
2022 年 10 月 8 日
You need to have X and Y vector arrays. The X values need to incapsulate the requested points. You may use interp1 fucntion. For example:
X=[6 1.256 10 ];
Y=[8 3.250 8.5 ];
Ynew = interp1(X,Y,[6.5, 7, 7.5])
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!