Solved


Angle Between Analog Clock Hands
Given a datetime variable t, return the angle (in degrees) between the hour and minute hands of an analog clock at the time repr...

2 months ago

Solved


Extract the Acrostic Message
An acrostic cipher is a way of embedding one message within another by taking the first (or last) word of each line. Given a str...

2 months ago

Solved


Boustrophedon
Given a vector v and a positive integer n, return an m-by-n matrix containing the elements of v row-wise, alternating left-to-ri...

2 months ago

Solved


Create block matrix of integers (j+k-1) - Part II
Given m, n, p, and q, create an m-by-n matrix made up of submatrices, each sized p-by-q (if possible - the last row and column o...

2 months ago

Solved


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

2 months ago

Solved


Dartboard Average II
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

2 months ago

Solved


Possible Rugby Scores
Given a natural number s (> 4), representing a rugby team's score, return an n-by-3 matrix representing all n possible combinati...

2 months ago

Solved


Combined Ages 2 - Symmetric, n ≥ 3
Following on <http://www.mathworks.com/matlabcentral/cody/problems/42382-combined-ages-1-symmetric-n-3 Combined Ages 2>, you wil...

4 months ago

Solved


Combined Ages 1 - Symmetric, n = 3
You have probably seen the common riddle wherein combined ages are provided and you must determine the individual ages. For exam...

4 months ago

Solved


Linear system of equations
Solve the system of equations in three variables.

4 months ago

Solved


System of equations
Find a solution to a system of equations represented by a |n| by |n+1| matrix. For instance, [ 2 0 4; => 2*x = 4 ...

4 months ago

Solved


linear least squares fitting
Inputs: * |f|: cell-array of function handles * |x|: column vector of |x| values * |y|: column vector of |y| values, same l...

4 months ago

Solved


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

4 months ago

Solved


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

5 months ago

Solved


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

5 months ago

Solved


Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

5 months ago

Solved


Operate on matrices of unequal, yet similar, size
You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

5 months ago

Solved


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

5 months ago

Solved


Some Assembly Required
The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...

5 months ago

Solved


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

5 months ago

Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

5 months ago

Solved


N-Dimensional Array Slice
Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

5 months ago

Solved


MatCAT - Reconstruct X from Its X-rays
Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...

5 months ago

Solved


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

5 months ago

Solved


Matrix of Multiplication Facts
This is James's daughter again, sneaking into his Cody account. Thanks to your help in my math class last year, I did great! But...

5 months ago

Solved


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

5 months ago

Solved


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

5 months ago

Solved


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

5 months ago

Solved


Find the definite integral of various linear functions
A definite integral had a minimum and maximum limit. When you solve this type of problem you must use both quad and the trapz fu...

5 months ago

Solved


How many days does the cat take to climb out of the hole?
A cat accidentally falls down a hole with sloping but rough sides. It can climb out of the hole of height h metres, but for ever...

5 months ago

Load more