How do I solve error of 'expected input signal to be finite'?

27 ビュー (過去 30 日間)
Cai Chin
Cai Chin 2021 年 2 月 3 日
編集済み: Walter Roberson 2021 年 2 月 3 日
Hi, I keep getting the error of 'Expected input signal to be finite' when I try and run the following code:
XTrain_v = [repmat(XTrainA_v(1:540),3,1); XTrainN_v(1:1620)];
instfreqTrain_v = cellfun(@(x)instfreq(x,fs)',XTrain_v,'UniformOutput',false);
XTrainA_v is a 549 x 1 cell array, whilst XTrainN_v is a 1622 x 1 cell array. Any suggestions would be greatly appreciated. Thanks in advance.
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 2 月 3 日
編集済み: Walter Roberson 2021 年 2 月 3 日
What shows up for
nfc1 = cellfun(@(C) nnz(~isfinite(C)), XTrainA_v(1:540));
nfc1idx = find(nfc1);
if ~isempty(nfc1idx)
fprintf('The following XTrainA_v cells contain non-finite values:\n');
disp(nfc1idx);
else
fprintf('XTrainA_v cells are all finite, excellent!\n');
end
nfc2 = cellfun(@(C) nnz(~isfinite(C)), XTrainN_v(1:1620));
nfc2idx = find(nfc2);
if ~isempty(nfc2idx)
fprintf('The following XTrainN_v cells contain non-finite values:\n');
disp(nfc2idx);
else
fprintf('XTrainN_v cells are all finite, excellent!\n');
end

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDesign Condition Indicators Interactively についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by