Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
wd w
wd w le 24 Fév 2024
Commenté : Voss le 25 Fév 2024
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).

Réponse acceptée

Voss
Voss le 24 Fév 2024
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 commentaires
wd w
wd w le 25 Fév 2024
Voss and Stephen23, thank you very much!
Voss
Voss le 25 Fév 2024
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by