Solved

Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

2 years ago

Solved

Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

2 years ago

Solved

All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

2 years ago

Solved

Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

2 years ago

Solved

Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...

2 years ago

Solved

Find max
Find the maximum value of a given vector or matrix.

2 years ago

Solved

Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

2 years ago

Solved

Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

2 years ago

Solved

Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

2 years ago

Solved

Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

2 years ago

Solved

Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

2 years ago

Solved

Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

2 years ago

Solved

Two fractions, one sum
Given a positive number x, write a MATLAB script that will tell you how many ways that the reciprocal of that number can be writ...

2 years ago

Solved

7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...

2 years ago

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

2 years ago

Solved

Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

2 years ago

Solved

Compute the step response of a DC motor
Compute the step response of a DC motor shown below <<http://blogs.mathworks.com/images/seth/cody/dc-motor.png>> The param...

2 years ago

Solved

Model a falling body
An object is falling freely from a height of 22 meters under the force of gravity. <<http://blogs.mathworks.com/images/seth/c...

2 years ago

Solved

Model a simple pendulum
Model a simple pendulum of length 200cm with bob of mass 100g and plot the position in degrees. The pendulum starts at 30 degree...

2 years ago

Solved

Make a low pass filter
Make a first order low pass filter that will filter out the high frequency oscillations for the given input signal. The cut-off ...

2 years ago

Solved

Sums of Multiple Pairs of Triangular Numbers
This is a follow-up to <https://www.mathworks.com/matlabcentral/cody/problems/44289 Problem 44289> - Find two triangular numbers...

2 years ago

Solved

Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

2 years ago

Solved

Find two triangular numbers whose sum is input.
Find two triangular numbers whose sum is _input_. Note: The difference beetween the triangular numbers should be minimum.

2 years ago

Solved

Produce a Fibonacci sequence
Construct a diagram that generates the Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34.....up to 377 The Fibonacci sequ...

2 years ago

Solved

Add damping to a mass spring system
Model an ideal mass-spring-damper system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/im...

2 years ago

Solved

Model a mass spring system
Model an ideal mass-spring system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/images/se...

2 years ago

Solved

Counting pulses in a signal
Count the number of pulses that are the result of summing each pulse generator block. Pulse Generator blocks produce a recurr...

2 years ago

Solved

The Top 5 Primes
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

2 years ago

Solved

Recaman Sequence - II
Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index. For example: if n =...

2 years ago

Solved

Inscribed Pentagon?
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

2 years ago