Question: Using Matlab Write a function ispalindrome that returns whether a given input string is a palindrome and also its reversal (strip out any non-alphabetical characters).

Using Matlab

Write a function ispalindrome that returns whether a given input string is a palindrome and also its reversal (strip out any non-alphabetical characters). A palindrome is a string that is the same as its reverse. e.g., "Was it a car or a cat I saw?!" is a palindrome because you get the same string when you reverse the order of the characters. The first thing you do with the input is to strip out any non-alphabetical characters and convert any upper case letters to lower case. So, "Was it a car or a cat I saw?!" will become "wasitacaroracatisaw". >> [ispal,rev]=ispalindrome('Was it a car or a cat I saw?!') ispal = logical 1 rev = 'wasitacaroracatisaw' >> [ispal,rev]=ispalindrome('Fool proof!') ispal = logical 0 rev = 'foorploof'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!