Working of editor and debugger, MATLAB in Statistics

Working of Editor and debugger:

Editor/Debugger, or commands can be typed from Command Window. For illustration, the dbstop command below will set a breakpoint in the fifth line of this function (that is the action of the if clause), that allows us to type the variable names and/or expressions to examine their values at that point in the execution. The dbcont function can be used to carry on the execution, and dbquit is used to quit the debug mode.

Note that the prompt becomes K>> in the debug mode.

>> dbstop testifelse 5

>> testifelse(-2)

5 disp('In middle of range')

K>> x

x =

   -2

K>> 3 < x

ans =

   0

K>> 3 < x < 6

ans =

   1

K>> dbcont

In middle of range

end

>> 

By typing the expressions 3 < x and then 3 < x < 6, we can conclude that the expression 3 < x will return either 0 or 1. Both 0 & 1 are less than 6, therefore the expression will always be true, despite of the value of x!

Posted Date: 10/20/2012 4:24:54 AM | Location : United States







Related Discussions:- Working of editor and debugger, Assignment Help, Ask Question on Working of editor and debugger, Get Answer, Expert's Help, Working of editor and debugger Discussions

Write discussion on Working of editor and debugger
Your posts are moderated
Related Questions
Types of errors: There are some various kinds of errors which can occur in a program, that fall into the categories of run-time errors, syntax errors, and logical errors. T

Median The median is defined only for a data set which has been sorted first, that means that the values are in order. The median of a sorted set of data values (n) is defined

Areacirc function: The areacirc function can be called from the Command Window as shown here, or from a script. Here is a script which will prompt the user for the radius of o

Example of Median For the vector [1 4 5 9 12 33], the median is the average of the 5 & 9 in the middle: >> median([1 4 5 9 12 33]) ans =     7

Help function: Function is computing the two values, there are two output arguments in the function header (i.e., area & circum), that are placed in the square brackets [ ]. A

Opening and Closing a File: The Files are opened with the fopen function. By the default, fopen function opens a file for reading. If the other mode is preferred, a permission

Example of customizing plots: As the other illustration of customizing plots, the pieces of a pie chart can be "exploded" from the rest. In this situation, the two vectors are

Debugging Techniques: Any error in the computer program is called a bug. This word is thought to date back to the 1940s, whenever a problem with an early computer was found to

Illustration of Indexing: Though, rather than of creating the index vector manually as shown here, the process to initialize the index vector is use to a sort function. The al

Functions which return Values versus printing: Also, the function which computes and returns values (throughout the output arguments) does not generally print them; that is le