Why do I get incorrect argument when calling "indeces"?
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);
Accepted Answer
More Answers (0)
Categories
Find more on Title 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!