Diferent answers to same cmd
古いコメントを表示
I am trying to figure out Matlab. Tried the cmd shown in the attachment, get different response(see attachment)
5 件のコメント
dpb
2025 年 2 月 20 日
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
2025 年 2 月 20 日
採用された回答
その他の回答 (1 件)
Walter Roberson
2025 年 2 月 20 日
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 件のコメント
Ken
2025 年 2 月 20 日
dpb
2025 年 2 月 20 日
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
2025 年 2 月 20 日
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!