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
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

Persistent Variables: Generally, whenever a function stops executing, then the local variables from that function are cleared. That means that each and every time a function i

WHILE Loops: The while statement is used as a conditional loop in MATLAB; it is used to repeat an action whenever ahead of the time it is not known how many times the action w

Generic code for Reading from Files: The generic code to complete this is as shown below:   fid = fopen('filename'); if fid == -1    disp('File open not suc

Example of Nested functions: For illustration, the function below computes and returns the volume of a cube. Three arguments are then passed to it, for the width and length of

Illustration of nested for loops and the if statements: For illustration,when the file contains: 33   -11  2  4      5   9 22     5  -7  2     11    3 the outco

Representing Logical true and False: It has been stated that expressions which are theoretically true really have the integer value of 1, and expressions which are theoretical

Need of a nested loop: How would we sum each individual column, rather than getting an overall sum? Answer: The programming technique would need a nested loop in whi

Sequential Search: A sequential search is completed by looping through the vector element-by-element starting from the beginning, looking for the key. Usually the index of the

Execution of persistent variables: The functions can also be called from the script or from the Command Window, as shown here. For illustration, the functions are called first