Why do I get an error "Expected signal input to be finite" when using wlanPacketDetect?
42 次查看(过去 30 天)
显示 更早的评论
I am using the WLAN toolbox to perform a packet recovery procedure on a custom generated waveform. When I try to detect the packet, I receive the following error:
Error using wlanPacketDetect
Expected signal input to be finite.
How can I fix this error?
采纳的回答
MathWorks Support Team
2021-1-11
This error is occurring because the signal that is being passed to wlanPacketDetect contains non-finite value(s).
To resolve the error, ensure that the received signal does not contain any infinite or NaN values before it is passed into wlanPacketDetect. If the signal is being imported into MATLAB (e.g. reading in a text or csv file), NaN or inf values may be introduced if an unexpected value is encountered. Ensure that any data processing takes this possibility into account to avoid the introduction of non-finite values.
0 个评论
更多回答(1 个)
Shoumei
2025-8-20,2:38
If there is a division operation beforehand, there is a possibility that NaN or Inf will be unintentionally input, and it is difficult to avoid this.
It is recommended to add a MATLAB function before the function/block where the error occurs, and replace NaN and Inf as shown below.

function y = fcn(u)
if isnan(u)
y = 0;
elseif isinf(u)
y = realmax('double'); % When input is single, realmax('single');
else
y = u;
end
This issue also occurs in Vision HDL Toolbox functions/blocks and degrades the user experience.
Instead of stopping the simulation, MATLAB/Simulink should continue the simulation with a warning.
For Japanese search
エラー:シミュレーション中にエラーが発生したため、シミュレーションを終了しました
原因:
'updateImpl' メソッドの実行中に、MATLAB System ブロック 'xxxx' 内の System object 'xxxx' で実行時のエラーが発生しました。
input data は有限にする必要があります。
Error in xxxx.p
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!