i have some problem in my code as call function and other syntax error .... anyone can help me to run the code correctly ..... the attachment files below

 Réponse acceptée

You have
Y lable (['Temperature\T_',num2str(jdx),' (c)'])
x lable ('Time')
Those are not valid commands. The commands are ylabel() and xlabel()

12 commentaires

Before it, I have a problem when I call the function.
Can you run the code in our laptop and show the error?
How can I preview results in table like this:
With fprintf() you can make it have a completely custom look like that. Study up on the fprintf() function - it's very useful to learn.
@Moath, your function Derivatives() contains several syntax errors. For example
hc.g-a = 5.7+(3.8*V_mat(i,j));
What does this mean? This is not a valid MATLAB syntax. I cannot suggest a solution because I don't know what is your intended result from this line. Unless you correct it, you will not be able to run your code.
does you mean why i put i , j in v_mat
this should be inside the two for loops because there is a 9 values for v i suggest that but may be wrong you can remove (i,j) from statment .... i think like that to make results in future in table
i have two variable with 9 values .... v_mat and I_mat .... how i can use one value every run to obtain 9 resulte for all vaiables
No, I mean what is on the Left-hand side of =. The left side should only contain variable in which you want to store value.
you can change variable name to hcga . i used it more than one time so change all of them you can named to any correct name .... not a problem
change from hc.g-a to hcga and check if not have error to run
i named the variable by this name 'hc.g-a' this between ' ' is the variable name
This is not a valid variable name in MATLAB. Even changing them have no effect because I just realized that all of these lines are placed after the end keyword. So they are not part of the function. Also in the function, the variables mCp_mat, Q_mat, Ib, Ibw are not defined. You need to correct the file Derivatives.m. Again, as I said previously, I have no idea what are you trying to do in this function, so it is impossible for me to suggest a solution.
Undefined function or variable 'Derivaties'.
because the function name is Derivatives
Your Derivatives code has an "end" on line three and then a bunch of lines of code that are outside of any function. Those lines of code include a number of lines such as
hc.g-a = 5.7+(3.8*V_mat(i,j));
which has a subtraction on the left hand side. We cannot tell if you are trying to set up an equation or if you should be using something like hc.g_a as the variable name (that seems more likely)
Your code in Derivatives refers to i and j, but you do not initialize those so they are going to refer to the imaginary unit, sqrt(-1)
Your code in Derivatives uses mCp_mat which does not exist inside that function. MATLAB is not going to look in the calling function in hopes of finding a variable with that name. You need to pass mCp_mat into the function. See

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by