Solved


Function minimization - beat fminsearch!
Sequel of problem 45948 <https://www.mathworks.com/matlabcentral/cody/problems/45948-function-minimization-beat-fminbnd> M...

7 days ago

Solved


Newton Interpolation
Given a set of measurements of dependent variables in a vector, Y, that vary with one independent variable in a vector, X, calcu...

7 days ago

Solved


Check if vertices form a rectangle
Given a set of 4 vertices defined by vectors X and Y, return true if the vertices form a rectangle and false otherwise. X and Y...

7 days ago

Solved


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

7 days ago

Solved


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

7 days ago

Solved


Josephus Survivor
The <http://en.wikipedia.org/wiki/Josephus_problem Josephus Challenge> is to find the position that is the last remaining when e...

8 days ago

Solved


Gray code
Given a decimal number, convert it to its corresponding Gray code (see https://en.wikipedia.org/wiki/Gray_code). 8 -- 1100...

8 days ago

Solved


"Bubblegum, Bubblegum, in a dish; How many pieces do you wish?"
The child's game "bubblegum, bubblegum, in a dish; how many pieces do you wish?" is a way of eliminating players until a single ...

8 days ago

Solved


Give a matrix that matches itself when rotated
Given n and s, return a n-by-n matrix a of integers such that sum(sum(a == rot90(a))) is equal to exactly s. The integer...

8 days ago

Solved


Compute a sum involving the zeta function
Write a function to compute the sum for , where is the zeta function, the subject of Cody Problems 45939, 45988, and 45997.

8 days ago

Solved


Count the ways to draw non-intersecting chords between points on a circle
There are 9 ways to draw non-intersecting chords between four points on the perimeter of a circle (including no chords at all). ...

8 days ago

Solved


Checkmate
* The positions of different chess pieces are given in a cell *p* . * The position of the king is given as *x* Determine i...

8 days ago

Solved


USC Spring 2012 ACM: Armageddon
This Challenge is to solve Question E, Armageddon, of the <http://contest.usc.edu/index.php/Spring12/Home USC ACM Spring 2012 Co...

8 days ago

Solved


Find out the Gray Code for a Given Binary Number
Find out <http://en.wikipedia.org/wiki/Gray_code Gray Code> for a given binary number Example Binary input 1000 Gray ...

8 days ago

Solved


Rotation Matrix to Euler Angles
Given a rotation matrix, generate the Euler Angles as output [phi,theta,psi]. [phi is a rotation around X-axis, theta is rotatio...

8 days ago

Solved


Compute the fractional derivative
Cody Problem 1370 asks us to compute the derivative of a polynomial. This problem extends that idea to fractional derivatives, w...

8 days ago

Solved


Kurchan Square - Evaluation Function
Evaluate a Kurchan square. An NxN square with values 1:N^2. Given a square matrix determine the products of each row, column,...

8 days ago

Solved


what can you get for exactly amount of money
You go to store, where each product has price. Prices are in vector s = [ 195 125 260 440 395 290] and you have amount ...

8 days ago

Solved


Persistence will help you solve almost any problem.
Create a function without inputs that adds one to the output every time it is called. a = counterfun; disp(a) >> 1 ...

8 days ago

Solved


LocateMembership | Membership of Matrix in another matrix
Let a and b be given by a = [ 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 4 0 0 0 ] b = [ 2 1 ...

8 days ago

Solved


Compute the intersect point of line and plan
Compute the intersect point of line and plan. eg. line AB, the coordinate of A is (1,2,3) the coordinate of B is (-4,-5,-6...

8 days ago

Solved


Identify Reachable Points
Given a vector of 2-D Points and a vector of 2-D Deltas create an array of all Locations that can be reached from the points usi...

8 days ago

Solved


Simple Past of Regular Verbs
Given a regular verb, return the simple past. Example Input verb = 'to work' Output simple_past = 'worked'

8 days ago

Solved


Compute the total length of lines between all vertices of a regular polygon
Write a function to compute the total length of between all vertices of a regular polygon inscribed in a unit circle. For exampl...

8 days ago

Solved


Parametric Array
Create a row vector, 1xN (Integer, >1), such that the mean of the vector is M (Real number) and the standard deviation of the ...

8 days ago

Solved


Reverse the Sign
Write a function that returns the input with the sign of every element reversed. The input may be a scalar, vector, or matrix. ...

8 days ago

Problem


Reverse the Sign
Write a function that returns the input with the sign of every element reversed. The input may be a scalar, vector, or matrix. ...

8 days ago | 0 | 7 solvers

Solved


Encoding Google Maps Polylines
This problem is based on the Google Polyline Encoder algorithm. This is how Google Maps encodes a line for display on a map. You...

9 days ago

Solved


Sokoban: Puzzle 10.45
The <http://www.game-sokoban.com/index.php?mode=level&lid=16138 Sokoban Site> has many puzzles to solve. This Challenge is to s...

9 days ago

Load more