I have some time/frequency data and I try to interpolate it using the interp2
function of Matlab. The data [F,T,data]
is obtained from a different Matlab routine of Matlab, spectrogram in case you are interested.
[~,F,T,data] = spectrogram(...)
data = 10*log10(data);
I can plot the data using surf
. The data is fine, I believe. However interpolating the data seems to be a problem. Even using interp2(F,T,data,F,T)
(so actually no interpolating) gives the error below.
What is going wrong here?
I have the data which I use here: https://www.dropbox.com/s/zr5zpfhp6qyarzw/test.mat
interp2(F,T,data,f,t)
Error using griddedInterpolant
The grid vectors do not define a grid of points that match the given values.
Error in interp2>makegriddedinterp (line 228)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 128)
F = makegriddedinterp({X, Y}, V, method,extrap);
>> size(F),size(T),size(data),size(f),size(t)
ans =
129 1
ans =
1 52
ans =
129 52
ans =
200 1
ans =
1 121