using matlab.int​ernal.math​.interp1 Input coordinates must be real. Error in interp1 (line 188) VqLite = matlab.int​ernal.math​.interp1(X​,V,method,​method,Xqc​ol);

3 ビュー (過去 30 日間)
Sara
Sara 2025 年 4 月 30 日
回答済み: Manish 2025 年 5 月 13 日
My backward pass works fine, however when i run my forward pass, it only runs til k value 1329. After that, it gives me an error.

回答 (1 件)

Manish
Manish 2025 年 5 月 13 日
Hi,
I understand you're facing an error while using the function 'interp1'.
The three parameters used in the 'interp1' function are 'x', 'v', and 'xq'. Among these, 'v' can be a complex number, but 'x' and 'xq' must be real.
Refer to the below documentation for more information:
I assume you are encountering this error after the value of k reaches 1329, because at this iteration, one of the parameters is changing from real to complex.
To check which variable is becoming complex, you can use the 'isreal' function.
Refer the below documentation for better understanding:
Hope it helps!

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by