While loops, MATLAB in Statistics

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 will be repeated. The common form of the while statement is as shown below:

while condition



The action that consists of any number of statements is executed as long as the condition is true. The condition should eventually become false to avoid an infinite loop. (If this occurs, Ctrl-C will exit the loop.)

The way it works is that, at first the condition is computed. If it is logically true, the action is executed. Therefore, to start with it is merely like an if statement. Though, at that point the condition is computed again. If it is still true, the action is executed once again. Then, the action is computed again. If it is still true, the action is executed again. Then, the action is... ultimately, this has to stop! Ultimately something in the action has to change something in the condition so it becomes false.



Posted Date: 10/19/2012 6:02:28 AM | Location : United States

Related Discussions:- While loops, Assignment Help, Ask Question on While loops, Get Answer, Expert's Help, While loops Discussions

Write discussion on While loops
Your posts are moderated
Related Questions
Steps for input output functions - Lower level file: The steps involved are as shown below:  Open the file.  Read the file, write to the file, or append to the file.

Use of function polyval: The better the curve fit, the more exact these interpolated and extrapolated values will be. By using the subplot function, we can loop to display the

Illustrations of Sequential search: The two illustrations of calling such function is as shown below: >> values = [85 70 100 95 80 91]; >> key = 95; >> seqsearch

Lower Level File I/O Functions: Whenever reading from data file, as long as the data in the file is "regular" the load function works-in another words, the similar type of dat

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

Vectorizing: In most of the cases in MATLAB, loops are not essential. As MATLAB is written specifically to work with the vectors and matrices, most operations can be completed

Statistics There are numerous statistical analyses which can be executed on data sets. In MATLAB software, the statistical functions are in the data analysis help topic known a

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

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

function sortrows - sorting strings: The function sortrows sorts each and every row as a block, or group, and it also will work on numbers. Here in this illustration the rows