Problem in interpolation of data.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniyal Ali
am 13 Okt. 2015
Kommentiert: Walter Roberson
am 13 Okt. 2015
The following code is giving me the error that "The grid vectors do not define a grid of points that match the given values". I tried to use linear and other methods too, but nothing works. Need help.
a=unique(Eo.signals.values(:,:));
b=unique(SOC.signals.values(:,:));
b1 = interp1(a,b,19,'spline','extrap')
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 13 Okt. 2015
What reason do you have for expecting that the number of unique values of one kind matches the number of unique values of the other kind, and that they should happen to be sorted in the same order?
are you sure you want to extrapolate at 19 exactly? That reads more like a number for the number of extrapolated values you would want.
I wonder if maybe you are looking for something closer to a cubic spline fit of the data?
2 Kommentare
Walter Roberson
am 13 Okt. 2015
Use the three output form of unique() to produce A and ia and ic (third output). Use ic to index the second array to get the values corresponding to each A value. Then the two will be the same length and in correspondence.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!