amir amir
amir amir

Reputation: 3435

Problem with Polynomials

I write this code in MATLAB :

X = [ 1 , 1 , 1 , 1 ]; Y = [ 0 , 1 , 1 , 1 ];

and when I use this below instruction MATLAB gives me an error :

[P,Q] = deconv( X , Y )

error message is :

??? Error using ==> deconv at 21 First coefficient of A must be non-zero.

Why does this message appear ? Please help me. thanks

Upvotes: 0

Views: 1470

Answers (1)

Amro
Amro

Reputation: 124553

In general, try the following to zero-trim Y on the left side:

ind = find(Y~=0, 1, 'first');
[q,r] = deconv(X, Y(ind:end))

Upvotes: 3

Related Questions