Using the functions char and double, one can shift words. For example, one can convert from lower case to upper case by subtracting 32 from the character codes:
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:7| Question number:26.7
All Answers
total answers (1)
Ch7Ex26.m
% Loop to decipher the code
code = 'Jmkyvih$mx$syx$}ixC';
code = char(double(code)-1);
disp(code)
choice = input('Enter ''c'' to continue: ','s');
while choice == 'c'
code = char(double(code)-1);
disp(code)
choice = input('Enter ''c'' to continue: ','s');
end
>> Ch7Ex26
Iljxuhg#lw#rxw#|hwB
Enter 'c' to continue: c
Hkiwtgf"kv"qwv"{gvA
Enter 'c' to continue: c
Gjhvsfe!ju!pvu!zfu@
Enter 'c' to continue: c
Figured it out yet?
Enter 'c' to continue: yes
>>
need an explanation for this answer? contact us directly to get an explanation for this answer