Solved


Restricted Addition v3
This problem is <https://www.mathworks.com/matlabcentral/cody/problems/45258-restricted-addition-v2 Restricted Addition v2> with...

2 months ago

Solved


Restricted Addition v2
This problem is Restricted Addition v1 with more restrictions. Also, you must handle negative and non-integer values. Add two n...

2 months ago

Solved


N-Queens: Count All Valid Arrangements
The N-Queens puzzle places N queens on an N×N chessboard such that no two queens attack each other. A queen can attack another ...

2 months ago

Solved


Function minimization - global minimum
Sequel of problem 45951 <https://www.mathworks.com/matlabcentral/cody/problems/45951> Can you do even better, within the r...

2 months ago

Solved


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

2 months ago

Solved


Function minimization - beat fminbnd!
Matlab's fminbnd function finds a minimizer of a function within an interval. If often gets stuck in local minima. Can you do...

2 months ago

Solved


Bounding Circle
The Bounding Circle is the smallest enclosing circle to a given set of points on a plane <https://en.wikipedia.org/wiki/Smallest...

2 months ago

Solved


Least Absolute Deviations (L1-norm) line fit - degree n
This is a generalization of Problem 45851 for degree n <https://www.mathworks.com/matlabcentral/cody/problems/45851-least-abs...

2 months ago

Solved


Least Absolute Deviations (L1-norm) line fit - degree 1
Matlab's polyfit function is very handy to find least-squares regression. It minimizes the (L2-norm) of the estimation errors, b...

2 months ago

Solved


What is the current time in Darwin, Australia?
Traders need to track exchange calendars and trading hours in detail, and account for time zone differences and daylight savings...

2 months ago

Solved


Convert vector datasets to plot with imagesc instead of scatter
For large datasets this allows much faster plotting. An irregular 2D spatial sampling is provided in x and y vectors with a d...

2 months ago

Solved


Magic Concentric Circles
Consider 4 magic circle circles around a single number in the sequence 1:n where the sum along the diameters is always equal, an...

2 months ago

Solved


Key Generation for Solitaire Cipher
The Solitaire Cipher by Bruce Schneier was introduced to Cody in two problems by Doug Hull: http://www.mathworks.com/matlabcent...

2 months ago

Solved


Borderline Connectivity
Compute the connected components of pixel borders. Suppose that h and v together describe a logical labeling of the borders b...

2 months ago

Solved


Approximate the inverse tangent by power series
Given values b (where abs(b)<=1) and n (polynomial order), write a function that calculates atan(b) by using power series.

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

2 months ago

Solved


Complete a 2nd order difference sequence
In Cody Problem 59791 ChrisR asks us to find the integer that completes a randomly sorted geometric sequence with one missing el...

2 months ago

Solved


increasing sequences
Given a string of digits, insert commas to create a sequence of strictly increasing numbers so as to minimize the magnitude of t...

2 months ago

Solved


Find the particular dividend
It is known that once you write the sequence 10101...101 long enough, the number will be finally divisible by any odd number if ...

2 months ago

Solved


factorial
There are really some cody problems related to factorial of n, e.g., 42667, 45184, 46054, and etc. It is interesting to ask why ...

2 months ago

Solved


three digits
Input three digits no larger than 4,say 1,2 and 3, write the possible largest number composed(concatenation and power) only by t...

2 months ago

Solved


prime consecutive sums
Create a number sequence of 1 to n, such that the sums of every two consecutive numbers are all primes. E.g. if n = 5, you may ...

2 months ago

Solved


how to concatenate matrices
What is the name of the function used to create a matrix C form two matrices A and B, using the syntax: C = [A B]; Outpu...

2 months ago

Solved


Persistence will not help you solve this problem.
Create a function without inputs that adds one to the output every time it is called. A different possibility of solving this ha...

2 months ago

Solved


Hilbert Scan Algorithm
As Zig-Zag and Horizontal ... we have also a < <Hilbert> <Scan> > as shown in this article <http://link.springer.com/chapter/10....

2 months ago

Solved


Stop a ZigZag scanning N*N Matrix at any diag you want
Suppose that we have a 2-D matrix and we try to obtain a 1-D array in zig-zag order, but not all values of our 2-D matrix e...

2 months ago

Solved


Adaptive ZigZag
Unfold a 2-D matrix to a 1-D array in Adaptive zig-zag order, e.g., for matrix [ 1 2 5 6; 3 4 7 8; 9 10 13 14; ...

2 months ago

Solved


Create a 3D rotation matrix from roll-pitch-yaw angles
Consider a robotics application where the world reference coordinate frame {W} and a robot manipulator arm with an attached tool...

2 months ago

Solved


Orientation of a 3D coordinate frame
The orientation of a body-fixed frame {B} with respect to the world frame {W} is described by an SO(3) rotation matrix. Compute...

2 months ago

Solved


Determine roll pitch yaw angles from a 3D rotation matrix
Consider an aerospace application where the world reference coordinate frame {W} and a body-fixed coordinate frame {B}. The ori...

2 months ago

Load more