Why do I get incorrect argument when calling "indeces"?

조회 수: 5 (최근 30일)
Alia Hicks
Alia Hicks 2020년 8월 13일
답변: Steven Lord 2020년 8월 13일
Why do I get this error about indeces?
" 'Check for missing argument or incorrect argument data type in call to function 'indices'. Error in AdaptdFilteredThenFFTed (line 38) indices PSD>35000; "
I'm borrowing the line of code defining it and any other lines using it from another program.
dt = .001;
t = 0:dt:3.999;
ich = AdaptiveFilteredData.VarName1;
qch = AdaptiveFilteredData.VarName2;
%plot(ich,qch);
%plot(t,ich);
%plot(t,qch);
%% Amp vs Time plot
figure;
plot(t,ich)
xlabel('time(s)');
ylabel('Amplitude');
grid on
%% FFTed
Nsamps = length(ich); % Window length
y_fft = abs(fft(ich)); %Retain Magnitude
%f = fs(1/(dt*n)*(0:n));
f = fs*(0:Nsamps/2-1)/Nsamps; %Prepare freq data for plot
%% Plot Mag vs Freq
figure;
plot(f, y_fft(1:length(f)));
%Magnitude vs Freplot(f, y_fft); % FFT plot
xlim([0 1]);
xlabel('Frequency(Hz)');
ylabel('FFT Magnitude');
grid on
%% Clean Then Revert
PSD = y_fft.*conj(y_fft)/Nsamps;
indices PSD>35000;
PSDclean = PSD.*indices;
fhat = indices.*fhat;
ffilt = ifft(fhat);
%% PlotClean Amp vs T
figure;
plot(t,ffilt);

채택된 답변

Steven Lord
Steven Lord 2020년 8월 13일
You're missing the equals sign (=) that would assign the result of the computation PSD>35000 to the variable indices, so MATLAB thinks you're trying to pass the char vector 'PSD>35000' into a function named indices. To fix, add the equals sign.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by