By using linear interpolation How can we find unkown 500 data values by using known data points(x,y,z) ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
swathi
le 2 Sep 2020
Réponse apportée : Ameer Hamza
le 2 Sep 2020
[x1,y1,z1] = [2 3 4]; % starting value
[xn,yn,zn] = [7 2 5]; % ending value
by using linear interpolation i want to generate 500 unkown values inbetween known starting and ending value...
i know the linspace function,,but i want to generate points by using only linear interpolation concept
i need your help
thank you?
0 commentaires
Réponse acceptée
Ameer Hamza
le 2 Sep 2020
If you consider are at [x1,y1,z1] at t=0 and [xn,yn,zn] at t=1, then you can write following line using linear interpolation
X1 = [2 3 4]; % starting value
Xn = [7 2 5]; % ending value
t1 = 0; % start time
tn = 1; % end time
t = linspace(0, 1, 500); % samples between start and end time
X = interp1([t1 tn], [X1; Xn], t);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!