Why does it give the error "Matrix dimensions must agree"??
1 view (last 30 days)
Show older comments
[y,Fs]=wavread('abc.wav'); y=y/(1.01*abs(max(y))); yy=buffer(y,909); N=909; w=window(@hamming,N); fnl=yy.*w;
2 Comments
dpb
on 19 Sep 2013
Cuz they don't??? :)
[y,Fs]=wavread('abc.wav');
y=y/(1.01*abs(max(y)));
yy=buffer(y,909);
N=909;
w=window(@hamming,N);
fnl=yy.*w;
Check what is
size(max(y))
??
Accepted Answer
Jan
on 19 Sep 2013
Perhaps the wav file is in stereo. Then abs(max(y)) is a vector and dividing y by this vector leads to this problem. Or perhaps yy and w do not have equal sizes, such that yy.*w must fail.
It would be useful if you post the complete error message, such that we do not have to guess, where the error occurs.
3 Comments
Jan
on 19 Sep 2013
@Rohit: No, "Matrix dimensions must agree" is not the complete message. When you want to discuss an error in the forum, post everything, which belongs to the error message, even if you do not know, if it matters.
You can check the sizes of yy and w by inserting this code:
size(yy)
size(w)
What do you see and what should yy .* w achieve then?
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices 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!