Can some one please help me with a homework problem thats driving me crazy!!
I need to make a function that scans the grades of a class, each time it sees a fail, a counter goes up by one.
This counter then saves the grade and position of the failing grade on the list.
This has to be done using a 'While loop"
I have written working code, however, my while loop is just as frivolous as the counter in countroles.
Marks = randi([0 100],1,10)Fail = [0:40]; no = ismember([Marks],[Fail]);B = sum(no);Counter = 0;while Counter < B Counter = Counter + 1end[c,x] = find(no == 1);Index = xResults = Marks(x)if a == 0 Results = "'Happy Days, No Fails' " Index = 0end
Thank you!
Best Answer