Use of functions ctrb and poly

2 views (last 30 days)
Ken
Ken on 18 Feb 2025
Commented: Ken on 18 Feb 2025
I have 2 matrices A, B. I use ctrb(A,B) to get matrix P and then try to use poly(P) to get the polynomial of P but get error msg saying it requires a vector or square matrix. Any suggestions?

Accepted Answer

Sam Chak
Sam Chak on 18 Feb 2025
No error message generated. You should provide yours to find out the actual issue.
A = [ 0 1;
-1 -2];
B = [ 0;
1];
P = ctrb(A, B)
P = 2×2
0 1 1 -2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
cp = poly(P)
cp = 1×3
1.0000 2.0000 -1.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
  1 Comment
Ken
Ken on 18 Feb 2025
Thanks - my B matrix was 2X2, SHOULD BE 2X1 like yours

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!