Borrar filtros
Borrar filtros

Error when interpolating data code attached

1 visualización (últimos 30 días)
shobhit mehrotra
shobhit mehrotra el 11 de Mzo. de 2015
Editada: per isakson el 11 de Mzo. de 2015
Im getting an error using the interp1, the workspace is attached. I think the issue is with te, where it jumps suddenly at indices 5139-5140. te is a time vector, eth is a concentration
ethi = interp1 (te, eth, (tg+5))
  3 comentarios
shobhit mehrotra
shobhit mehrotra el 11 de Mzo. de 2015
te: time for mass spectrometer
tg: gps time
eth: concentration of ethane (parts per billion)
shobhit mehrotra
shobhit mehrotra el 11 de Mzo. de 2015
the code and workspace are attached Thank You!

Iniciar sesión para comentar.

Respuesta aceptada

per isakson
per isakson el 11 de Mzo. de 2015
Editada: per isakson el 11 de Mzo. de 2015
I get an error when I run your code
>> ethi = interp1 (te, eth, (tg+5));
Error using griddedInterpolant
The grid vectors are not strictly monotonic increasing.
Error in interp1 (line 191)
F = griddedInterpolant(X,V,method);
The message, The grid vectors are not strictly monotonic increasing., is clear enough.
>> issorted( te )
ans =
1
>> issorted( tg )
ans =
1
so far so good
>> any(diff(te)==0)
ans =
1
>> any(diff(tg)==0)
ans =
0
Thus, te is not strictly monotonic
>> find(diff(te)==0)
ans =
11034
>> te(11032:11036)'
ans =
1.0e+09 *
1.4164 1.4164 1.4164 1.4164 1.4164
>> format hex
>> te(11033:11036)'
ans =
41d51b408950b780 41d51b408950be0e 41d51b408950be0e 41d51b408950c49c
>>
>> figure, plot( te(11030:11040) )
&nbsp
&nbsp
Did you get the same or a different error message?
&nbsp
This works
>> te(11034)= te(11035)-eps(te(11035));
>> ethi = interp1 (te, eth, (tg+5));
>> te(11033:11036)'
ans =
41d51b408950b780 41d51b408950be0d 41d51b408950be0e 41d51b408950c49c

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by