Skip to main content
1-Visitor
July 4, 2023
Solved

Linear Interpolation from Table

  • July 4, 2023
  • 1 reply
  • 1338 views

MH_10592278_0-1688474632441.png

As shown above when I tried to linear interpolate the D values corresponding to h/d values of column 1. It is showing following error, Kindly help me. 

 

 

Best answer by Werner_E

Isn't the error message self-explanatory?

The elements of the first argument vector must be in ascending order. your vector is in DEscending  order, so you have to resort it (and of  course also vector D (which contains constant values anyway.
What do you expect your function to return? Anything else than 0.8 for any input value?

Furthermore you should not name the function and the vector the same (D).

 

BTW, it would be polite if, after you asked a question here in he forum, that you come back, comment on the answers and close the thread or explain whats still missing -> what to create a table with variable value from a ... - PTC Community

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
July 4, 2023

Isn't the error message self-explanatory?

The elements of the first argument vector must be in ascending order. your vector is in DEscending  order, so you have to resort it (and of  course also vector D (which contains constant values anyway.
What do you expect your function to return? Anything else than 0.8 for any input value?

Furthermore you should not name the function and the vector the same (D).

 

BTW, it would be polite if, after you asked a question here in he forum, that you come back, comment on the answers and close the thread or explain whats still missing -> what to create a table with variable value from a ... - PTC Community

1-Visitor
July 4, 2023

Thank you for your help, It worked.