Counting in a while loop, MATLAB in Mathematics

Counting in a While Loop:

Whenever it is not known ahead of the time how many values will be entered into the script, it is often essential to count the number of values which are entered. For illustration, if numbers are read into the script, and then the average of the numbers is preferred, the script should add them together, and keep the track of how many there are, in order to compute the average. The variation below on the script counts the number of numbers which the user successfully enters:

1537_Counting in a While Loop.png

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







Related Discussions:- Counting in a while loop, Assignment Help, Ask Question on Counting in a while loop, Get Answer, Expert's Help, Counting in a while loop Discussions

Write discussion on Counting in a while loop
Your posts are moderated
Related Questions
Matrix of Plots: The other function which is very useful with any type of plot is subplot that creates a matrix of plots in the present Figure Window. The three arguments are

Fliplr function: The fliplr function "flips" the matrix from left to right (in another words the left-most column, the first column, become the last column and so on), and the

Types of User-defined Functions: We know how to write a user-defined function, stored in an M-file, which computes and returns one value. This is merely one type of the functi

Illustration of nested function: The output arguments are distinct from variables. The scope of an output argument is merely the nested function; and it cannot be used in the

strvcat function - concatenation: The function strvcat will concatenate it vertically, that means that it will generate a column vector of the strings.   >> strvcat(fir

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

Refer the subset of a matrix: It is also possible to refer to the subset of a matrix. For illustration, this refers to the first & second rows, second & third columns: >> m

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Error-Checking for Integers: As MATLAB uses the type double by default for all the values, to check to make confirm that the user has entered an integer, the program have to c

Changing Dimensions: In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, resh