Spline issues with due to data with inconsistent step sizes
3 views (last 30 days)
Show older comments
I have a very large matrix, it consists of the solar energy available at each wavelength from 200nm to 4000nm. The problem is that it steps through these at irregular interavals, it starts off with 0.5nm increments, then proceeds to 1nm increments and at higher wavelengths the step size is 5nm.
How would I be able to estimate/sample the data so that I only have the values with increments of 1nm between the wavelengths (x value).
I have tried using spline and interpolate, but have had no success. Example below where solx is the current x values and soly is the corresponding y values. And x is the range of desired wavelengths with steps of 1nm
newysol=spline(solx,soly,x);
2 Comments
John D'Errico
on 8 Sep 2017
A spline has no requirement that the step sizes be uniform.
Please post your data, so we can see what you are doing.
Stephen23
on 8 Sep 2017
"I have tried using spline and interpolate, but have had no success"
And if you do not show us what you are doing, how do you expect us to help you?
Answers (0)
See Also
Categories
Find more on Splines in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!