x = input ('Please input range of values for x: ');while x <= 0 disp('One or more inputted data is not a positive integer') x = input ('Please re-input range of values for x: ');end
MATLAB: Please how do i make this while statement check all non-positive integers in the vector x below
#vectorconditioning#whilestatements
Related Question
- Write a function ShowPrimes(n) that will find all prime numbers between 1 and n and return them as a vector. Do this using a for loop. Hint: use isprime(x) to check whether x is a prime number. As an example, >> primes=ShowPrimes(20) primes =
- How to use non-positive or fractional integer as power in matlab
Best Answer