Diferent answers to same cmd
Ältere Kommentare anzeigen
I am trying to figure out Matlab. Tried the cmd shown in the attachment, get different response(see attachment)
5 Kommentare
dpb
am 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
am 20 Feb. 2025
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 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 Kommentare
Ken
am 20 Feb. 2025
dpb
am 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
am 20 Feb. 2025
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!