Diferent answers to same cmd
Show older comments
I am trying to figure out Matlab. Tried the cmd shown in the attachment, get different response(see attachment)
5 Comments
dpb
on 20 Feb 2025
Include the code as text, not images...
A=[-.01 .1 0 32.2;-0.4 -.8 180 0;0 -.003 -.5 0;0 0 1 0]
B=[0 -10 -2.8 0]'
P=ctrb(A,B)
P=poly(P)
So, how do you get a different result?
A1=[-.01 .1 0 32.2;-0.4 -.8 180 0;0 -.003 -.5 0;0 0 1 0];
B1=[0 -10 -2.8 0]';
P1=ctrb(A,B);
P1=poly(P1);
all(P1==P)
Provided code doesn't produce different results for the same inputs...
Ken
on 20 Feb 2025
Accepted Answer
More Answers (1)
Walter Roberson
on 20 Feb 2025
A=[-.01 .1 0 32.2;-0.4 -.8 180 0;0 -.003 -.5 0;0 0 1 0]
Your screen image shows you using -32.2 rather than 32.2
4 Comments
Ken
on 20 Feb 2025
dpb
on 20 Feb 2025
Again, post THE EXACT CODE as text that you ran that shows the differing results; trying to do something with images is futile...and my aging eyes couldn't see the difference Walter spotted (although he's not that much younger than I... <vbg>)
If this happens, you should be able to execute the code here and have it spit out the different results.
It's virtually a certainty that the issue is something like what Walter saw, but it's not provable without the actual code/data.
Ken
on 20 Feb 2025
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!