Why do I get an error "Expected signal input to be finite" when using wlanPacketDetect?

45 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Jan 2021
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.

More Answers (1)

Shoumei
Shoumei on 20 Aug 2025 at 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

Categories

Find more on WLAN Toolbox in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!