Respuesta aceptada

Image Analyst
Image Analyst el 13 de Jul. de 2022
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);

Más respuestas (0)

Productos

Versión

R2021b

Preguntada:

AAS
el 12 de Jul. de 2022

Respondida:

el 13 de Jul. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by