How can I add query points between two adjacent points of sampled data?

2 ビュー (過去 30 日間)
wd w
wd w 2024 年 2 月 24 日
コメント済み: Voss 2024 年 2 月 25 日
I have a representative subset of sample points as shown in column A (x), and intend to add query points (evenly) in interval of each two adjacent sample points of column A to make it as shown in column B (Xq).

採用された回答

Voss
Voss 2024 年 2 月 24 日
x = [1;3;4;6;10]
x = 5x1
1 3 4 6 10
n = 4; % number of points to insert in each interval
N = numel(x);
q = linspace(1,N,(n+1)*(N-1)+1);
Xq = interp1(1:N,x,q).'
Xq = 21x1
1.0000 1.4000 1.8000 2.2000 2.6000 3.0000 3.2000 3.4000 3.6000 3.8000
  3 件のコメント
wd w
wd w 2024 年 2 月 25 日
Voss and Stephen23, thank you very much!
Voss
Voss 2024 年 2 月 25 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by