Write a script that tests whether the user can follow instructions. It prompts the user to enter an ‘x’. If the user enters anything other than an ‘x’, it prints an error message – otherwise, the script does nothing
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:4| Question number:1.4
All Answers
total answers (1)
Ch4Ex1.m
% Can the user follow instructions??
inx = input('Enter an x: ', 's');
if inx ~= 'x'
fprintf('That was no x!\n')
end
need an explanation for this answer? contact us directly to get an explanation for this answer