I need to understand what's the mistake and how to define vector

1 回表示 (過去 30 日間)
Akshay Chakrapani
Akshay Chakrapani 2022 年 9 月 20 日
コメント済み: Akshay Chakrapani 2022 年 9 月 24 日
Hello,
I'm very new to MATLAB and I somehow learnt how to do modelling from the onramp course offered by the official course. The equations are accoring to the thermal modelling or some mass balancing from my thesis reference that I learnt but that i not an issue. This is a bit crutial for me because I'm at the end stage of my thesis work and I need to finish my course as soon as possible. I'm stuck with this situation that I cannot solve this. Please I'm in need of help
The error what I'm getting is {{Undefined function or variable 'u'. Function 'Producer/Producer' (#102.159.163), line 7, column 10: "u(2)"}}
  5 件のコメント
Walter Roberson
Walter Roberson 2022 年 9 月 20 日
The variable truly is undefined at that point. We could guess that maybe u_p should be used in the code instead of u but since there is no documentation and the single comment does not describe any of the variables, it is only a guess.
Akshay Chakrapani
Akshay Chakrapani 2022 年 9 月 24 日
Yes, i corrected that error !!! thank you soo much

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

回答 (1 件)

Steven Lord
Steven Lord 2022 年 9 月 20 日
When MATLAB runs line 7 of your code, it tries to access the second element of the variable u (or to call a function named u with one input, the number 2.)
Assuming you actually intended to index into a variable named u, where on any of the previous lines (lines 1 through 6) did you define the variable u?
I agree with Walter that you likely meant to index into u_p on lines 7 and 8 instead of u.
  1 件のコメント
Akshay Chakrapani
Akshay Chakrapani 2022 年 9 月 24 日
Yess :) thank you both
i got a new kind of error now but let me see what i can do

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by