Program to counting in a while loop, MATLAB in Engineering

Program to Counting in a while loop:

The script initializes variable counter to 0. Then, in the while loop action, each and every time the user successfully enter a number, the program increments the counter variable. At the finish of the script, it prints the number of numbers which were entered.


>> countposnum

Enter a positive number: 4

You entered a 4.

Enter a positive number: 8

You entered a 8.

Enter a positive number: 11

You entered a 11.

Enter a positive number: -4

Thanks, you entered 3 positive numbers


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

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

Write discussion on Program to counting in a while loop
Your posts are moderated
Related Questions
Sound Files: The sound signal is an illustration of a continuous signal which is sampled to result in a discrete signal. In this situation, sound waves traveling through the a

Illustration of gauss-jordan elimination: An illustration of interchanging rows would be r1 ¬→ r3, that would results: Now, beginning with this matrix, an illustration of sc

Built-in colormaps: The MATLAB has numerous built-in colormaps which are named; the reference page on colormap shows them. Calling the function colormap without passing any ar

I have a 400x2 vel.dat and 20x2 xy.dat file, how can i plot a streamslice graph on matlab with this two files.

Function used in binary search: The function below implements this binary search algorithm. It receives two arguments: the sorted vector and a key (on the other hand, the func

Example of Interpolation and extrapolation: The MATLAB has a function to do this, known as polyfit. The function polyfit finds the coefficients of the polynomial of the partic

Illustration of Preallocating a Vector: Illustration of calling the function: >> myveccumsum([5 9 4]) ans =     5  14  18 At the first time in the loop, outvec wil

Binary Search: The binary search supposes that the vector has been sorted first. The algorithm is just similar to the way it works whenever looking for a name in a phone direc

Set Operations: The MATLAB has numerous built-in functions which perform set operations on vectors. These involve intersect, union, setdiff, unique, and setxor. All these func

Removing Whitespace Characters: The MATLAB has functions which will eliminate trailing blanks from the end of a string and/or leading blanks from the starting of a string.