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

조회 수: 39 (최근 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 CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by