??? Error using ==> interp1 at 261 The values of X should be distinct. Error in ==> StallPower_20131029_S809 at 10 c=interp1(rc_table(:,2),rc_table(:,3),rad);
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
AbdelRahman Elkattan
el 30 de Oct. de 2013
Respondida: ES
el 30 de Oct. de 2013
When i'm using iterp1 with rc_table, displaying this message
??? Error using ==> interp1 at 261
The values of X should be distinct.
Error in ==> StallPower_20131029_S809 at 10
c=interp1(rc_table(:,2),rc_table(:,3),rad);
What is the problem and its solution, Please?
rc_table :
1 1 0.345899000000000
2 1.50000000000000 0.712727000000000
3 2 0.661241000000000
4 2.50000000000000 0.609755000000000
5 3 0.560511000000000
6 3.50000000000000 0.511266000000000
7 4 0.459780000000000
8 4.50000000000000 0.408293000000000
9 5 0.356807000000000
10 5.50000000000000 0.308684000000000
1 comentario
Walter Roberson
el 30 de Oct. de 2013
Could you check size(rc_table,1) and length(unique(rc_table(:,2)))
Respuesta aceptada
ES
el 30 de Oct. de 2013
For your data it works fine. All it says is values in X must be distinct and monotonously increasing. Your X is
rc_table(:,2)
and its values are
1.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
5.0000
5.5000
which are unique and monotonically increasing. If I were you, I would check the data again and check if there is any accidental conversion to integer type.
for example, if you had done int8(rc) somewhere, then interpolation would fail.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!