How can I discretize a smooth curve?

16 visualizaciones (últimos 30 días)
Tay
Tay el 7 de Mayo de 2020
Comentada: Stephen23 el 24 de Nov. de 2021
If I have a smooth curve and I want to discretize this curve in some steps how can I do it? I saw some funtion in matlab but is does not work in my curve. See the image below.
  9 comentarios
Lazaros Christoforidis
Lazaros Christoforidis el 7 de Mayo de 2020
np, you could rescale your x, y values

Iniciar sesión para comentar.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 7 de Mayo de 2020
Try using the discretize function
y=linspace(3.5,3.4965);
x=linspace(0,1000);
plot(x,y)
% discretize
[Y,E] = discretize(y,20);
hold on
plot(x,E(Y),'--r')
hold off
Also, consider looking into the stairstep graph, though that seems to put the steps outside the curve again.
  5 comentarios
Lazaros Christoforidis
Lazaros Christoforidis el 7 de Mayo de 2020
yeah thats smooth
Tay
Tay el 8 de Mayo de 2020
Thanks guys !! It's perfectly working !! :D :)

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by