How to make a plot with multiple x points have equal spaced points?

1 vue (au cours des 30 derniers jours)
Tasha Williams
Tasha Williams le 25 Juin 2021
Commenté : Tasha Williams le 25 Juin 2021
I am trying to take a plot and make it have equal spacing.
I have tried interpolation but I get "The grid vectors must contain unique points" error
Not exactly sure how to fix this.
I've tried...
xx=min(FMX):0.01:max(FMX);
FMX=cumsum(ones(size(FMX)))*eps + FMX;
ind = diff(FMX)>0; % indices where dxmale is nonzero
MY = interp1(FMX(ind),FMY(ind),xx);
&&
xx=min(FMX):0.01:max(FMX);
ind = diff(FMX)>0; % indices where dxmale is nonzero
MY = interp1(FMX(ind),FMY(ind),xx);

Réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 25 Juin 2021
You can try unique() to remove some overlapping points and then interpolate.
  1 commentaire
Tasha Williams
Tasha Williams le 25 Juin 2021
I tried that it did not work. There's a need for both x values.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by