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

조회 수: 2 (최근 30일)
Tasha Williams
Tasha Williams 2021년 6월 25일
댓글: Tasha Williams 2021년 6월 25일
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);

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 25일
You can try unique() to remove some overlapping points and then interpolate.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by