Diferent answers to same cmd
Afficher commentaires plus anciens
I am trying to figure out Matlab. Tried the cmd shown in the attachment, get different response(see attachment)
5 commentaires
dpb
le 20 Fév 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
le 20 Fév 2025
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 20 Fév 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 commentaires
Ken
le 20 Fév 2025
dpb
le 20 Fév 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
le 20 Fév 2025
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!