필터 지우기
필터 지우기

interp1 using thresholding

조회 수: 1 (최근 30일)
AAS
AAS 2022년 7월 12일
답변: Image Analyst 2022년 7월 13일
Is there any way to interpolate selective points in an array while keep others fixed?

채택된 답변

Image Analyst
Image Analyst 2022년 7월 13일
Try this:
x = (1:10)';
y = [2.14 3.66 4.55 4.55 4.55 4.55 8.89 8.89 14.43 14.43]';
plot(x, y, 'b.-', 'MarkerSize', 30);
grid on;
xticks(1:10);
% Predict the value at x=6.5
xi = 6.5;
yi = interp1(x, y, xi)
yi = 6.7200
% Plot interpolated point in green.
hold on;
plot(xi, yi, 'g.', 'MarkerSize', 40);
% Draw lines.
line([xi, xi], [0, yi], 'Color', 'g', 'LineWidth', 2);
line([0, xi], [yi, yi], 'Color', 'g', 'LineWidth', 2);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by