Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using MatLab: If the following two functions are saved in one script file, which

ID: 3604224 • Letter: U

Question

Using MatLab:

If the following two functions are saved in one script file, which of the following statement is true?

Question 6 options:

A: We should name the file as avg

B: We should put stat2 afte avg in order to make it work

C: We can either name the file as stat2.m or avg.m, it will not cause any problem.

D: We should name the file as stat2

A: We should name the file as avg

B: We should put stat2 afte avg in order to make it work

C: We can either name the file as stat2.m or avg.m, it will not cause any problem.

D: We should name the file as stat2

Explanation / Answer

Here the Function avg is a local function.
Local functions are only available to other functions within the same file.

If we Call function stat2 from the command line.
and the values we are giving

values = [12.7, 45.4, 98.9, 26.6, 53.1];
[ave,stdev] = stat2(values)
ave = 47.3400
stdev = 29.4124

Answer:
C.We can either name the file as stat2.m or avg.m, it will not cause any problem.

Hope this will helps you.Thank you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote