> MATLAB Beginners Coding Question:?

MATLAB Beginners Coding Question:?

Posted at: 2014-12-18 
Your function has to be written so it returns a value. Let's say your function calc_green_strain returns one value, so you call it this way:

a = calc_green_strain(arguments);

Then first of all, just leaving off the semicolon will cause the value of a to display after the function returns.

a = calc_green_strain(arguments)

and that's all you need in your "Display results" function. But you probably want a little more control over when it displays.

You could also do it this way:

a = calc_green_strain(arguments);

a

The second line, a without a semicolon, will cause it to display.

And then there's formatted output with functions like FPRINTF, but I don't know if you've seen that yet.

I have an assignment in a coding class asking me to display the results of previous functions that I have coded. I named the file display_results and my previous functions work when I type them in the command window but I cannot get anything to display the results of these functions in the editing window. I have never used MATLAB before this so the more details the better. Thank you!

Here is the question:

PROBLEM 4

--

DISPLAY RESULTS

--

display_results.m

-------------------------------------------------

Write a script that simply calls your other functions with some trial values and DISPLAYS the results.

Remember that if you leave the semicolon off a line of code (ie when you call a function) it will display the value.

My previous functions are named calc_green_strain.m, calc_rms.m, and calc_sphere_vol_sa.m