Why do I get incorrect argument when calling "indeces"?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Alia Hicks
am 13 Aug. 2020
Beantwortet: Steven Lord
am 13 Aug. 2020
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 Kommentare
Akzeptierte Antwort
Steven Lord
am 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Title finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!