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

31 Ansichten (letzte 30 Tage)
Cai Chin
Cai Chin am 3 Feb. 2021
Bearbeitet: Walter Roberson am 3 Feb. 2021
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 Kommentar
Walter Roberson
Walter Roberson am 3 Feb. 2021
Bearbeitet: Walter Roberson am 3 Feb. 2021
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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by