Boxcar wont recognize a double

7 ビュー (過去 30 日間)
Braden Kerr
Braden Kerr 2020 年 12 月 17 日
コメント済み: Braden Kerr 2020 年 12 月 18 日
Hello,
I am working on an assignment and we were provided with some sample code to use for part of a problem. When I input the code, I get the following error
Undefined function 'boxcar' for input arguments of type 'double'.
for this bit of code
Fs=1/dt; % sampling frequency (need to define T)
nfft = 1024; % number of points to use
noverlap = nfft/2; % number of points to overlap
window = boxcar(nfft); % don’t smooth ends
leny = length(time2); % length of time history
v = x2(leny-nfft+1:leny,2); % use last samples of vel(steady state)
[Pxx,F] = pwelch(v,window,noverlap,[],Fs); % compute PSD
I have read the description for pwelch and somewhat understand how its being used, but Im not quite sure why boxcar is returning an error.
  2 件のコメント
Sravan Pentlavelly
Sravan Pentlavelly 2020 年 12 月 17 日
編集済み: Sravan Pentlavelly 2020 年 12 月 17 日
Hi,
Can you confirm the following details
  1. Is signal processing toolbox already installed in your machine ?
You can check this by typing ver in MATLAB command window
2. Do you have any other user defined function named boxcar in your MATLAB path?
You can verify this by typing ‘which boxcar.m’ in the MATLAB command prompt . Ideally you should
have boxcar.m file in following location in case of windows.
C:\Program Files\MATLAB\<MATLABVERSION>\toolbox\signal\signal\boxcar.m
Braden Kerr
Braden Kerr 2020 年 12 月 18 日
This was it, I guess when I updated to 2020b I lost a lot of the apps I thought I had. Thank you

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by