Solved


"mirror" matrix
Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

7 years ago

Solved


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

7 years ago

Solved


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

7 years ago

Solved


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

7 years ago

Solved


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

7 years ago

Solved


Divide the Least Common Multiple by the Greatest Common Divisor of two numbers
Divide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer...

7 years ago

Solved


Divisible by 10
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

7 years ago

Solved


Dice roll - lateral faces
For this problem, you will be provided with the values of a dice roll (regular six-sided dice). The number of dice will be at le...

7 years ago

Solved


Dice roll - opposite faces
For this problem, you will be provided with the values of a dice roll (regular six-sided dice). The number of dice will be at le...

7 years ago

Solved


The Dark Side of the Die
It is well-known that opposite sides of a classic hexahedral die add to 7. Given a vector of dice rolls, calculate the sum of th...

7 years ago

Solved


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

7 years ago

Solved


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

7 years ago

Solved


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

7 years ago

Solved


Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1...

7 years ago

Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

7 years ago

Solved


Mirror Image matrix across anti-diagonal
Given an input number x, create a Mirror Image matrix 'Y' across anti-diagonal in following way:- Example:- If x=3, Y= [1 ...

7 years ago

Solved


Create a matrix with difference of each row of input matrix
With a given input matrix A, create a output matrix B in such a way that each row in B is a difference of rows of input matrix A...

7 years ago

Solved


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

7 years ago

Solved


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

7 years ago

Solved


BULLSEYE Part 2: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

7 years ago

Solved


BULLSEYE Part 3: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 69s and 0s around the center point. Examples: Input ...

7 years ago

Solved


Ring Matrix
Given n (only odd), return output matrix a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. ...

7 years ago

Solved


Number of odd and even elements within matrix
Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

7 years ago

Solved


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this...

7 years ago

Solved


Spiral Matrix
for a given integer n>=3, generate a matrix of nxn such that the value n^2 is at bottom left and its decreasing towards center ...

7 years ago

Solved


0, 2, 0, -2, 0, 2, 0, -2, ...
Generate the first n terms of a periodic sequence defined as f(x) = 0, 2, 0, -2, 0, 2, 0, -2, ..., for x = 1, 2, 3, 4, 5, 6...

7 years ago

Solved


make an eye matrix which element is 1:n
for a given input n, make an n by n matrix which contains elements 1:n for example input =5 output = [1 0 0 0 0;0 2 0 0 0; 0...

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

7 years ago

Solved


Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

7 years ago

Solved


Average valid values of arrays
Given a 1D array (column or row vector), compute the average of valid values. Valid values are defined via two thresholds: minVa...

7 years ago

Load more