Illustration of script documentation, MATLAB Programming

Illustration of script Documentation:

For illustration, the script to compute the area of a circle could be modified to have comments:

2281_Illustration of script Documentation.png

The first comment at the starting of the script explains what the script does. Then, throughout the script, comments explain various parts of the script (not generally a comment for every line, though!). The Comments don't affect what a script does; therefore the output from this script would be similar as for the earlier version.

The help command in a MATLAB works with scripts as well as with the built-in functions. The initial block of comments (defined as adjacent lines at the starting) will be displayed. For illustration, for script1b:

>> help script1b

This program evaluates the area of a circle

The reason that a blank line was inserted in the script between the first two comments is that otherwise both would have been interpreted as one adjacent comment, and both lines would have been displayed with help. The very first comment line is known as the H1 line; it is what the function look for searches through.

Posted Date: 10/18/2012 5:45:53 AM | Location : United States







Related Discussions:- Illustration of script documentation, Assignment Help, Ask Question on Illustration of script documentation, Get Answer, Expert's Help, Illustration of script documentation Discussions

Write discussion on Illustration of script documentation
Your posts are moderated
Related Questions
I need my data mining assignment done. Can you guys help me with that?

#quest121ion..

hi i have this programm function [IRN,number ] = randnumbers( IRN ) IRN=int32(IRN) ITOTAL=(IRN*330)+100 ITOTAL=int32(ITOTAL); IQUOTIENT=ITOTAL/2303 IQUOTIENT=int32(IQUOTIENT);

The Efficient Method: Though, in MATLAB, there is another built-in function which specifically produces random integers, i.e. randint. Calling the function with randint (1,1,n


Problem 1:   What are the different methods that can be used to solve a differential equation? Please provide a numbered list. Problem 2:   For a first order linear d

Diary Files: Before doing this assignment, please read the document Notes on Matlab Assignments (available from the course web page). It describes how to record the results of your

Generates sin or cos wave using plot functions: The script generates an x vector; iterating through all the values from 0 to 2*π in steps of 2*π /40 gives sufficient points to

Q. The steady-state circuit i(t) in a series RL circuit due to a periodic sawtooth voltage is given by where θ n = tan -1 (nω 0 L/R).With the parameters V A = 25 V, T 0

1. Assume that there exists a surface that can be modeled with the equation:  z = e-(x 2 + y 2 ).  a) Calculate ∇z at the point (x = 0, y = 0). b) In addition, use MATLAB to