The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
A function generatevec generates a vector of n random integers (where n is a positive integer), each in the range from 1 to 100, but all of the numbers in the vector must be different from each other (no repeats). So, it uses rand to generate the vector and then uses another function all diff that will return logical 1 for true if all of the numbers in the vector are different or logical 0 for false if not in order to check. The generatevec function keeps looping until it does generate a vector with n non-repeating integers. It also counts how many times it has to generate a vector until one is generated with n nonrepeating integers and returns the vector and the count. Write the all diff function.

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------