Why do I get incorrect argument when calling "indeces"?
1 view (last 30 days)
Show older comments
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);
0 Comments
Accepted Answer
Steven Lord
on 13 Aug 2020
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 Comments
More Answers (0)
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!