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

3 visualizaciones (últimos 30 días)
Akshay Chakrapani
Akshay Chakrapani el 20 de Sept. de 2022
Comentada: Akshay Chakrapani el 24 de Sept. de 2022
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 comentarios
Walter Roberson
Walter Roberson el 20 de Sept. de 2022
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 el 24 de Sept. de 2022
Yes, i corrected that error !!! thank you soo much

Iniciar sesión para comentar.

Respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by