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

1 view (last 30 days)
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 Comments

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 20 Sep 2022
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 Comment
Akshay Chakrapani
Akshay Chakrapani on 24 Sep 2022
Yess :) thank you both
i got a new kind of error now but let me see what i can do

Sign in to comment.

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!