By using linear interpolation How can we find unkown 500 data values by using known data points(x,y,z) ?
조회 수: 2 (최근 30일)
이전 댓글 표시
[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
채택된 답변
Ameer Hamza
2020년 9월 2일
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!