To RESHAPE the number of elements must not change.

3 views (last 30 days)
vale is 1x1200;
nfft= 1024; % number of frequency samples
Navg= 8; % number of DFT's to be averaged
N= nfft*Navg; % number of time samples
n= 0:N-1; % time index
w= hamming(nfft); % window function
window= w.*sqrt(nfft/sum(w.^2)); % normalize window for P= 1 W
%
% Create matrix xMatrix with Navg columns,
% each column a segment of x of length nfft
xMatrix= reshape(vale,nfft,Navg);

Answers (1)

Walter Roberson
Walter Roberson on 24 Feb 2020
vale is 1200 entries. You are trying to reshape it to be an array 1024 by 8. That cannot work.
  10 Comments
Walter Roberson
Walter Roberson on 25 Feb 2020
The : index like window(:) can never lead to that error (for numeric data types).
window.*xMatrix
Provided you are using R2016b or later.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!