Diferent answers to same cmd

4 Ansichten (letzte 30 Tage)
Ken
Ken am 20 Feb. 2025
Kommentiert: Sam Chak am 21 Feb. 2025
I am trying to figure out Matlab. Tried the cmd shown in the attachment, get different response(see attachment)
  5 Kommentare
Ken
Ken am 20 Feb. 2025
The original post showed 2 images of the 2 separate cmds used with the resultswhich are quite different, cannot dig why they are different
Voss
Voss am 20 Feb. 2025
@Ken: What are the different results/responses you see? Only one of your screenshots shows a result in the command window, which is the result of P=poly(P), a command which does not appear in the other screenshot.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ken
Ken am 21 Feb. 2025
As mentioned earlier, I am trying to get familiar with MATLAB in aircraft controls. Focus now is Matlab. I saw a presentation with Matlab code which I posted a screenshot of. (I also posted my code to compare). Tried to duplicate the code but do not get the result shown in the Matlab window of the screenshot. Trying to figure out if something missing on my end.
  1 Kommentar
Sam Chak
Sam Chak am 21 Feb. 2025
Hi @Ken,
Thank you for your response. One plausible explanation for the differing results is that your Aircraft Control Professor may have used functions from a decade-old version of MATLAB and the Control System Toolbox. Most professors I know do not frequently update their lecture slides. Therefore, if you are using more recent versions of MATLAB and the Control System Toolbox, you are likely obtaining different results.
The best approach would be to post the Control Problem Example from the lecture slides so that we can verify which result is correct or more accurate. In some rare cases, bugs can occur after MATLAB is updated.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
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
Ken am 20 Feb. 2025
I am trying to compare my code with one at a presentation of which I do not have the code in text. I thought ctrb gives the matrix and poly gives the polynomial of that matrix equation.
Sam Chak
Sam Chak am 20 Feb. 2025
Hi Mr. @Ken
I noticed from your screenshots that your issue pertains to the controller design problem. Would you please describe the original control problem so that we can understand the full context that led to the 'cmd' issue?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by