About CAT arguments dimension are not consistent

3 views (last 30 days)
MU
MU on 20 Feb 2013
Hello, guys, i face a problem, please help me~
clear all;
clc;
[x Fs]=wavread('PhoneNumberA_2013.wav');
N=length(x);
x=[x 0];
K =round([697 770 852 941 1209 1336 1407]*N/8000);
y=zeros(1,N);
for k=1:7
v_1=0;
v_2=0;
v=0;
for i=1:N+1
v_2=v_1;
v_1=v;
v=2*cos(2*pi*k/N)*v_1-v_2+x(i);
end
y(K(k)) = v-exp(-j*2*pi*k/N)*v_1;
end
k=0:N-1;
stem(k,y)
The error information said Error using horzcat CAT arguments dimensions are not consistent. the specific error lies in x=[x 0]
I do not how to fix that, plz help me, thank you

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 20 Feb 2013
Edited: Azzi Abdelmalek on 20 Feb 2013
If x is a column vector, you can t make an horizontal concatenation. Maybe you should do
x=[x;0]

More Answers (0)

Community Treasure Hunt

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

Start Hunting!