Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

etwa 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Mehr laden