From: FAISAL PEER MOAHMED on
Hi

I wish to add zeros the end of the signal. I have used horizontal concatenation. Please see the code below.

q= ones(1,1966081 );
w=[q zeros(1023,1)];

It ends up with an error.

Error using ==> horzcat
CAT arguments dimensions are not consistent.

Please help

Regards

Faisal
From: Sean on
"FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message <ht0mh1$req$1(a)fred.mathworks.com>...
> Hi
>
> I wish to add zeros the end of the signal. I have used horizontal concatenation. Please see the code below.
>
> q= ones(1,1966081 );
> w=[q zeros(1023,1)];
>
> It ends up with an error.
>
> Error using ==> horzcat
> CAT arguments dimensions are not consistent.



You're trying to concatenate a [1x1966081] with a [1023x1]. It's not going to work:
try:
>> w=[q zeros(1,1023)];
From: Wayne King on
"FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message <ht0mh1$req$1(a)fred.mathworks.com>...
> Hi
>
> I wish to add zeros the end of the signal. I have used horizontal concatenation. Please see the code below.
>
> q= ones(1,1966081 );
> w=[q zeros(1023,1)];
>
> It ends up with an error.
>
> Error using ==> horzcat
> CAT arguments dimensions are not consistent.
>
> Please help
>
> Regards
>
> Faisal

Hi, that's because q is a row vector while w is a column vector.

Wayne
From: FAISAL PEER MOAHMED on
Thanks. I have tried , same error repeats

Regards

Faisal




"Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <ht0nd8$pbb$1(a)fred.mathworks.com>...
> "FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message <ht0mh1$req$1(a)fred.mathworks.com>...
> > Hi
> >
> > I wish to add zeros the end of the signal. I have used horizontal concatenation. Please see the code below.
> >
> > q= ones(1,1966081 );
> > w=[q zeros(1023,1)];
> >
> > It ends up with an error.
> >
> > Error using ==> horzcat
> > CAT arguments dimensions are not consistent.
>
>
>
> You're trying to concatenate a [1x1966081] with a [1023x1]. It's not going to work:
> try:
> >> w=[q zeros(1,1023)];
From: Doug Hull on
a = [1 2 3];
a(10) = 0

a =

1 2 3 0 0 0 0 0 0 0


"FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message <ht0oak$r20$1(a)fred.mathworks.com>...
> Thanks. I have tried , same error repeats
>
> Regards
>
> Faisal
>
>
>
>
> "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <ht0nd8$pbb$1(a)fred.mathworks.com>...
> > "FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message <ht0mh1$req$1(a)fred.mathworks.com>...
> > > Hi
> > >
> > > I wish to add zeros the end of the signal. I have used horizontal concatenation. Please see the code below.
> > >
> > > q= ones(1,1966081 );
> > > w=[q zeros(1023,1)];
> > >
> > > It ends up with an error.
> > >
> > > Error using ==> horzcat
> > > CAT arguments dimensions are not consistent.
> >
> >
> >
> > You're trying to concatenate a [1x1966081] with a [1023x1]. It's not going to work:
> > try:
> > >> w=[q zeros(1,1023)];