Solved


Hard limit function
Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

mehr als 2 Jahre ago

Solved


ASCII Birthday Cake
Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

mehr als 2 Jahre ago

Solved


Breaking Out of the Matrix
Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

mehr als 2 Jahre ago

Solved


MATLAB Counter
Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

mehr als 2 Jahre ago

Solved


Polarisation
You have n polarising filters stacked one on top of another, and you know each axis angle. How much light gets passed through th...

mehr als 2 Jahre ago

Solved


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

mehr als 2 Jahre ago

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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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>...

mehr als 2 Jahre 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...

mehr als 2 Jahre ago

Solved


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

mehr als 2 Jahre 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...

mehr als 2 Jahre 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!...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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 ...

mehr als 2 Jahre 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 ...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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://...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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 ...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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...

mehr als 2 Jahre 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.

mehr als 2 Jahre 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...

mehr als 2 Jahre ago

Load more