Why do I get incorrect argument when calling "indeces"?
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Title についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!