How do I solve error of 'expected input signal to be finite'?
조회 수: 27 (최근 30일)
이전 댓글 표시
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
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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!