Effacer les filtres
Effacer les filtres

How can I discretize a smooth curve?

8 vues (au cours des 30 derniers jours)
Tay
Tay le 7 Mai 2020
Commenté : Stephen23 le 24 Nov 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 commentaires
Lazaros Christoforidis
Lazaros Christoforidis le 7 Mai 2020
np, you could rescale your x, y values

Connectez-vous pour commenter.

Réponse acceptée

Cris LaPierre
Cris LaPierre le 7 Mai 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 commentaires
Lazaros Christoforidis
Lazaros Christoforidis le 7 Mai 2020
yeah thats smooth
Tay
Tay le 8 Mai 2020
Thanks guys !! It's perfectly working !! :D :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by