Solved


Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

7 years ago

Solved


Largest territory
Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number. ...

7 years ago

Solved


counting groups!
This problem is about counting groups. Example If you have x: x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9] then a...

7 years ago

Solved


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

7 years ago

Solved


Time Expansion
How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

7 years ago

Solved


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

7 years ago

Solved


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

7 years ago

Solved


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

7 years ago

Solved


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

7 years ago

Solved


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

7 years ago

Solved


Esoteric Trigonometry
From Wikipedia: "All of the trigonometric functions of an angle θ can be constructed geometrically in terms of a unit circle cen...

7 years ago

Solved


Radiation Heat Transfer — View Factors (3)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

7 years ago

Solved


Radiation Heat Transfer — View Factors (2)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

7 years ago

Solved


Packing oranges - one layer
Help the seller to pack oranges efficiently. How many oranges can be put into a box in one layer without squeezing them? Give...

7 years ago

Solved


Cut an orange
Inspired by problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2175 2175>. A hungry matlab enthusiast has an ora...

7 years ago

Solved


Distance between two GPS Coordinates
A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

7 years ago

Solved


rectangle in circle
In the figure below, the rectangle at the corner measures a cm x b cm. What is the radius of the circle in cm? <<http://www....

7 years ago

Solved


Avalaible area: wall construction
You need to build a wall to enclose a certain area. Calculate the available area after you build the wall. Assumptions * ...

7 years ago

Solved


Wayfinding 3 - passed areas
This is the third part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the...

7 years ago

Solved


Wayfinding 2 - traversing
This is the second part of a series of assignments about wayfinding. The final goal is to be able to calculate the fastest route...

7 years ago

Solved


Wayfinding 1 - crossing
This is the first part of a series of assignments about wayfinding. The final goal is to be able to calculate the fastest route ...

7 years ago

Solved


Parallel vectors
Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

7 years ago

Solved


Vector parallel to plane?
Given the coefficients of the equation which defines a plane as follows: ax+by+cz=d, return a boolean indicating whether the 2n...

7 years ago

Solved


distance to a straight line (2D) given any 2 distinct points on this straight line
Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answ...

7 years ago

Solved


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

7 years ago

Solved


Pairwise Euclidean Distance
Given two matrices A,B of dimensions NxK and NxL respectively, calculate the pairwise euclidean distance of all vectors (columns...

7 years ago

Solved


Do the lines intersect?
You are given two line segments. Do they cross? Consider one segment as (x1,y1) to (x2,y2), the other segment as (x3,y3) to (...

7 years ago

Solved


LASER Tracker - Mirror Distance and Angle
Determine the mirror's distance and relative angle to the LASER Tracker given the distances to a reference SMR (Spherical Mounte...

7 years ago

Solved


Acid and water
&#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; Assume that there is a 100 liter tank. It is initially fi...

7 years ago

Solved


Digit concentration in Champernowne's constant
Consider the first 50 digits of Champernowne's constant 0.12345678910111213141516171819202122232425262728293... The...

7 years ago

Load more