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

17 visualizaciones (últimos 30 días)
Cai Chin el 3 de Feb. de 2021
Editada: Walter Roberson el 3 de Feb. de 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 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Walter Roberson el 3 de Feb. de 2021
Editada: Walter Roberson el 3 de Feb. de 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

Iniciar sesión para comentar.

### Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by