Is there a way for Densifying data towards the ends

1 Ansicht (letzte 30 Tage)
Abdulaziz Abutunis
Abdulaziz Abutunis am 29 Sep. 2021
Kommentiert: Star Strider am 30 Sep. 2021
Hello
I have x-y data that I want to increase its number and make it denser towards the ends because I want to fit a polynomial and want to capture all the details at the ends so it matches the original curve. The reason I am increasing the # of data is that I want to unify with other data. Please see the attached figure I made trying to visualize my requist.
Thanks

Akzeptierte Antwort

Star Strider
Star Strider am 29 Sep. 2021
I would use a weighting vector to weight the parts to be emphasized more heavily.
One way to do that could be:
N = 50; % Number Of Data Points
w = abs(linspace(-10, 10, N)); % Weighting Vector
It would also be possible to square ‘w’ instead of taking the absolute value.
Experiment to get the desired result.
.
  2 Kommentare
Abdulaziz Abutunis
Abdulaziz Abutunis am 30 Sep. 2021
Thank you for you response. I tried your steps and this gave me a more data at the middel I guess.
If you can advice me how to make it more dense towards the ends that will be helpful
Thank you again for the answer
Star Strider
Star Strider am 30 Sep. 2021
I am not certain what you are doing.
The point of my Answer was to weight the ends more than the rest of the vector, so they would be proportionally more influential in the parameter estimation. This is a relatively common practice.
That should not have resulted in more data, only in making the data seem denser (to the fitting function) at the ends, without actually changing anything.
.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by