Community Profile Robert

Active since 2021

Statistics

• • • • • • • • • • • Content Feed

View by

Solved

Divisible by 3
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

1 day ago

Solved

Divisible by 2
This is the first problem in a set of "divisible by x" problems. You will be provided a number as a string and the function you ...

1 day ago

Solved

Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the user's portion of the current search...

2 days ago

Solved

Multiples of a Number in a Given Range
Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

2 days ago

Solved

Proper Factors
Generate the proper factors of input integer x and return them in ascending order. For more information on proper factors, refer...

2 days ago

Solved

Find vampire numbers
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...

2 days ago

Solved

Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

3 days ago

Solved

Coin Tossing: Probability of Same Heads for N tosses
A pair of physicists toss a coin n times each. What is the probability that they tossed the same number of heads? *Input:*...

4 days ago

Solved

The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

4 days ago

Solved

German tank problem
The German tank problem is a well-known statistical problem that attempts to estimate the maximum of a discrete distribution fro...

4 days ago

Solved

Break it up! Break it up!
You have N pennies. Write a Matlab script that will reveal how many different ways you can break up those pennies. For example...

5 days ago

Solved

Simulating the selection of a state with given probabilities
Lets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which...

6 days ago

Solved

Guess the number I'm thinking of (Part 1)
In this game you are competing against two other people to guess the number that I'm thinking of. I randomly choose an integer ...

6 days ago

Solved

Given n, create n random numbers such that their standard deviation is also n.
Given n, create n random numbers such that their standard deviation is also n.

7 days ago

Solved

Suppress the French accent. Example 'Déjà présent' -> 'Deja present'

8 days ago

Solved

All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

8 days ago

Solved

Bang Bang in Bangalore
Imagine a strange language disorder, Bangolangosis, has developed among trigonometricians of <http://en.wikipedia.org/wiki/Banga...

8 days ago

Solved

Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

8 days ago

Solved

Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

8 days ago

Solved

Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

8 days ago

Solved

Space Saver
Remove all characters that are below a space in ASCII value.

8 days ago

Solved

Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

8 days ago

Solved

Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

11 days ago

Solved

Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

11 days ago

Solved

Use of regexp
Given a string, containing several sentences, such as: 'I played piano. John played football. Anita went home. Are you safe?...

11 days ago

Solved

Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifm...

11 days ago

Solved

Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

12 days ago

Solved

kmph to mps
convert kilometer per hour to meter per second

12 days ago

Solved

The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

12 days ago