Solved


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

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

12 years ago

Solved


Rainbow matrix
Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

12 years ago

Solved


Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

12 years ago

Solved


Sum Rows
Sum the same indexed (unique) rows. Examine the test suite. Related Challenge - <http://www.mathworks.com/matlabcentral/cody/...

12 years ago

Solved


A matrix of extroverts
Now that the introverts have had their script, the extroverts spoke up (naturally!) and demanded one as well. You will be given...

12 years ago

Solved


A matrix of introverts
You are given a matrix full of numbers who happen to be very shy. Write a MATLAB function that will put a square of zeros aroun...

12 years ago

Solved


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

12 years ago

Solved


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

12 years ago

Solved


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

12 years ago

Solved


Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

12 years ago

Solved


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

12 years ago

Solved


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

12 years ago

Solved


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

12 years ago

Solved


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

12 years ago

Solved


Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

12 years ago

Solved


Only once: cleaning up your columns
We have a logical array (with ones and zeroes). It is simple: after processing every column may only contain a single true value...

12 years ago

Solved


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

12 years ago

Solved


Back to basics 5 - Clipboard
Covering some basic topics I haven't seen elsewhere on Cody. Copy the input string to the clipboard

12 years ago

Solved


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

12 years ago

Solved


Find the day for a date
Today's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YY...

12 years ago

Solved


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

12 years ago

Solved


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

12 years ago

Solved


Consecutive Powers
Return 2 numbers and 2 powers such that their difference is 1 A 4 element row vector is expected: x where x(1)^x(2) - x(...

12 years ago

Solved


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

12 years ago

Solved


poll: would you like the regexp (?@cmd) functionality to be banned in Cody?
This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of rege...

12 years ago

Solved


Number of problems
No, you don't read it wrong: this assignment is to return the number of this problem (and not the problem of this number).

12 years ago

Solved


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

12 years ago

Solved


Formatting currency numbers
Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

12 years ago

Solved


Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

12 years ago

Load more