MATLAB: When i run this code i’m getting and error stating “matrix dimensions must agree”,how can i solve this error

dimension errormatrix

frame=y(2001:2001+fsize);
>> plot(frame);
>> plot(frame.*hamming(length(frame)));

Best Answer

Add transpose to first line:
frame=y(2001:2001+fsize)';
Element-by-element multiplication works only if both vectors are horizontal/vertical.