Q:

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

0

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. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

total answers (1)

Similar questions


need a help?


find thousands of online teachers now