Gistlib Logo

gistlib

while loop to chekc if its y or n in matlab

main.m
choice = '';

while ~(strcmp(choice, 'y') || strcmp(choice, 'n'))
    choice = input('Enter y or n: ', 's');
end
disp('Valid choice entered');
143 chars
7 lines

similar matlab code snippets

find an average of ten random numbers input by the user in matlab
how to count from -1 to 101 in matlab
call a method of a class and pass in a string as input in matlab
make a random 100-by-100 matrix in matlab
while loop in matlab
calculate the frequency of letters in words in matlab
find the thirteen adjacent digits in the 1000-digit number that have the greatest product. what is the value of this product? in matlab
how to replace each element in a array with the row of another array in matlab
implement factorial in matlab
how to do function argument evaluation in matlab

related categories

matlab
loops
input

gistlibby LogSnag