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

2 months ago

Solved


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

2 months ago

Solved


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

2 months ago

Solved


Replace secondary diagonal elements of a square array
Replace all the secondary diagonal elements of the square array A with the number n Example: A = [1 2 3 4 5 6 ...

2 months ago

Solved


Minimum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/min.html min> function can operate along either the rows or the columns...

2 months ago

Solved


Compute the period of a pendulum started from a finite initial angle
Cody Problem 49830 asks for the period of a pendulum swinging through a small angle. Here the pendulum started at rest from an ...

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

2 months ago

Solved


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

2 months ago

Solved


(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

2 months ago

Solved


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

2 months ago

Solved


return row and column indices given 2 values which define a range
Inspired by problem http://www.mathworks.co.kr/matlabcentral/cody/problems/856-getting-the-indices-from-a-matrice Inputs: - matr...

2 months ago

Solved


expand intervals vol.3
This is the next problem after <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528> and <http://www.mathworks.co.u...

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

2 months ago

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

2 months ago

Solved


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

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

2 months ago

Solved


Finding neighbors of [-1:1] in a matrix....
Hello All! Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that sh...

2 months ago

Solved


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

2 months ago

Solved


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

2 months ago

Solved


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

2 months ago

Solved


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

2 months ago

Solved


Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

2 months ago

Solved


Combined Ages 4 - Non-symmetric with multiples, n ≥ 3
This problem is slightly more difficult than <http://www.mathworks.com/matlabcentral/cody/problems/42383-combined-ages-3-non-sym...

3 months ago

Solved


Outer product of multiple vectors
In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional arra...

3 months ago

Solved


Combined Ages 3 - Non-symmetric, n ≥ 3
Pursuant to the previous two problems ( <http://www.mathworks.com/matlabcentral/cody/problems/42382-combined-ages-1-symmetric-n-...

3 months ago

Solved


Animated GIF Creator
This Challenge is to execute the Function Template which has a fully functional Animated GIF creator of a shape related to a Zer...

3 months ago

Solved


Solve equation numerically
y'=y In order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the metho...

3 months ago

Solved


Solve system of equation!
Given provided system of equation, and find x and y. System of equation can be expressed as each term's coefficient. For exam...

3 months ago

Solved


Find x in provided equation!
x^2-2*x+1=0 This polynomial can be expressed by using each term's coefficients, such as [1 -2 1]. Using the polynomial ...

3 months ago

Solved


Calculate solution of given polynomial
For example, y=function([3 -2 -4]) In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation. y=[1.5...

3 months ago

Load more