Question: Write a Matlab program to accept a string as input and determine if this string is a palindrome. A palindrome is a sentence that
Write a Matlab program to accept a string as input and determine if this string is a palindrome. A palindrome is a sentence that reads the same backward as forward, such as "Reward a Toyota drawer" or Napoleon's classic lament, "Able was I ere I saw Elba". Punctuation marks, blanks, and letter cases shall have no effects. Therefore your program should remove punctuation marks and blanks first, convert all letters to lowercase, then determine if the resulting string reads the same backward as forward. Output appropriate messages. You cannot use the built-in functions upper, lower, deblank, or isletter. Run your program with the two sentences given above, then "Today is such a nice day!" and "A man, a plan, a cat, a canal: Panama!"
Step by Step Solution
3.42 Rating (152 Votes )
There are 3 Steps involved in it
Here is a MATLAB program that checks if a given string is a palindrome by removing p... View full answer
Get step-by-step solutions from verified subject matter experts
