Logical errors, MATLAB in Statistics

Logical errors:

The Logical errors are more complicated to locate, as they do not result in any error message. The logical error is a mistake in reasoning by the programmer, but it is not a fault in the programming language. An illustration of a logical error would be dividing by 2.54 rather than of multiplying in order to convert inches to centimeters. The outcome printed or returned would be wrong, but this may not be obvious.

All the programs must be robust and must wherever possible anticipate potential errors, and guard against them. For illustration, whenever there is input into a program, the program must error-check and make sure that the input is in the accurate range of values. Also, before dividing, the denominator must be checked to make sure that it is not zero.

In spite of the best precautions, there are bound to be errors in the programs.

 

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







Related Discussions:- Logical errors, Assignment Help, Ask Question on Logical errors, Get Answer, Expert's Help, Logical errors Discussions

Write discussion on Logical errors
Your posts are moderated
Related Questions
Tracing: Sometimes, when a program has loops and/or selection statements and is not running properly, it is helpful in the debugging process to know exactly which statements h

Index vector: The index vector is then used as the indices for original vector. To get grades vector in ascending order, the indices used would be grades (2), grades (5), and

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

Nested Structures: The nested structure is a structure in which at least one of the members is itself a structure. For illustration, a structure for the line segment may co

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

Example of Functions which return values: Calling this function prints the circumference, since there is no way to store the value, hence, it can be used in following computat

Illustration of Binary search: An illustration to search for the key of 91 in the vector is as shown below: The table below shows what will happen in each iteration of

Example of Mode When no value appears more often than any other, the smallest value in the vector will be the mode of the vector. >> shortx = [2 5 1 4]; >> mode(shortx

The IF Statement: The if statement selects whether or not the other statement, or group of statements, is executed. The common form of the if statement is as shown below: i

MENU Function: The MATLAB also has a built-in function known as menu which will display a figure Window with push buttons for the choices. The very first string passed to the