Problem 639. String substitution, sub problem to cryptoMath
This is a sub problem related to this problem:
http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition
If you have a string
'cab'
and you have a mapping where you want:
'abc' to map to the digits [906]
then you will get this:
% 'cab' , 'abc', [906] --> [6 9 0];
Another example is:
% 'feed', 'def', [541] --> [1 4 4 5];
Your inputs will be of this form:
out = stringSubstitute(string, letters, digits)
>> stringSubstitute('feed','def',[5 4 1])
ans =
1 4 4 5
Solution Stats
Problem Comments
Solution Comments
Show commentsGroup

Strings I
- 30 Problems
- 102 Finishers
- Guess Cipher
- QWERTY Shift Encoder
- Calculate a modified Levenshtein distance between two strings
- Find matching string from a list of strings
- Find matching parenthesis
- Transposition as a CIPHER
- Decimal Comparison
- Return the first and last characters of a character array
- Find Rotated Substring
- Cell Counting: How Many Draws?
- Split a string into chunks of specified length
- Ordinal numbers
- Add more zeros
- Without the French accent please!
- Calculate a modified Levenshtein distance between two strings
- Calculate the Hamming distance between two strings
- Find mistyped words in text (mixed-up letters)
- QWERTY Shift Code Decoder
- QWERTY Shift Encoder
- Convert a structure into a string
- Return the first and last characters of a character array
- String substitution, sub problem to cryptoMath
- Number of 1s in a binary string
- Transposition as a CIPHER
- Use of regexp
- Pig Latin to English Translator
- English to Pig Latin Translator
- Formatting currency numbers
- Bang Bang in Bangalore
- Compress strings (not springs)
- letter yes yes & letter no no
- Convert String to Morse Code
- Decimal Comparison
- Find matching string from a list of strings
- Find Rotated Substring
- Reverse the Words (not letters) of a String
- Space Saver
- Find matching parenthesis
Problem Recent Solvers232
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!