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
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
please i applied the step to call function but doesnt success .... help me please
Accepted Answer
Walter Roberson
on 27 May 2018
You have
Y lable (['Temperature\T_',num2str(jdx),' (c)'])
x lable ('Time')
Those are not valid commands. The commands are ylabel() and xlabel()
12 Comments
Moath Maqableh
on 27 May 2018
Edited: Image Analyst
on 27 May 2018
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
Moath Maqableh
on 27 May 2018
Edited: Moath Maqableh
on 27 May 2018
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
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Tags
See Also
on 27 May 2018
on 27 May 2018
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)