??? 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_tab​le(:,3),ra​d);

1 次查看(过去 30 天)
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

采纳的回答

ES
ES 2013-10-30
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 个)

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by