I need help to figure out why these variables aren't being found.

9 ビュー (過去 30 日間)
DJ V
DJ V 2024 年 10 月 16 日
移動済み: Voss 2024 年 10 月 22 日
I have written simulink code that is to produce variables that later are to be read into Matlab. Unfortunately, Matlab interprets those variables using the following errors:
>> EqnsOfMotionback
Warning: Variable 'pn' not found.
> In EqnsOfMotionback (line 95)
Warning: Variable 'pe' not found.
> In EqnsOfMotionback (line 96)
Warning: Variable 'pd' not found.
> In EqnsOfMotionback (line 97)
Warning: Variable 'phi' not found.
> In EqnsOfMotionback (line 98)
Warning: Variable 'psi' not found.
> In EqnsOfMotionback (line 99)
Warning: Variable 'theta' not found.
> In EqnsOfMotionback (line 100)
Why are all these variables not being found? I put them in a specific directory on purpose. I don't want to leave it to a computer's whim or some vaguely known "rule".

採用された回答

Walter Roberson
Walter Roberson 2024 年 10 月 16 日
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\Pn.mat","pn");
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\Pe.mat","pe");
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\Pd.mat","pd");
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\phi.mat","phi");
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\psi.mat","psi");
load("C:\Users\1537268928E\OneDrive - United States Air Force\Desktop\theta.mat","theta");
The warning messages are telling you that pn is not being found in Pn.mat, and pe is not being found in Pe.mat and so on.
Possibly the variables are named Pn and Pe in the .mat files.
  20 件のコメント
Walter Roberson
Walter Roberson 2024 年 10 月 21 日
移動済み: Voss 2024 年 10 月 21 日
There is an implicit "1" to start with. The 1 is multiplied by the inputs that are marked as multiplication, and is divided by inputs that are marked as division. For example you could have two divisions A and B, and that would be (1/A) * (1/B)
DJ V
DJ V 2024 年 10 月 22 日
移動済み: Voss 2024 年 10 月 22 日
Now, more fun. I'm trying to control the direction of motion of the aircraft, but it seem that when I do this, I move it off the screen instantly. The errors it is outputting are as follows:
Error using matlab.graphics.chart.primitive.Line/set
Invalid or deleted object.
Error in EqnsOfMotionback>drawPlaneBody (line 166)
set(handle, 'XData', XYZ(1,:), 'YData',XYZ(2,:), 'ZData',XYZ(3,:));
Error in EqnsOfMotionback (line 117)
handle =
drawPlaneBody(pn(k),pe(k),pd(k),phi(k),theta(k),psi(k),handle);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by