Solved

Must be in the front row...

You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

6 Monate ago

Solved

Go to the head of the class!

You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

6 Monate ago

Solved

Numbers spiral diagonals (Part 2)

Inspired by Project Euler n°28 and 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right ...

6 Monate ago

Solved

Diagonal of a Spiral Matrix

Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

6 Monate ago

Solved

Triangular matrices in 3D array

Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...

6 Monate ago

Solved

Numbers spiral diagonals (Part 1)

Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

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

6 Monate ago

Solved

Energy of a photon

*⚛ ☢ ⚛ ☢ ⚛ ☢ ⚛* Given the frequency F of a photon in giga hertz. Find energy E of this...

6 Monate ago

Solved

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

6 Monate ago

Solved

Alternating sum

Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

6 Monate ago

Solved

Sum of first n terms of a harmonic progression

Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

6 Monate ago

Solved

Write a function man that takes a row vector v and returns a matrix H as follows..

Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

6 Monate ago

Solved

Project Euler: Problem 8, Find largest product in a large string of numbers

Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

6 Monate ago

Solved

Project Euler: Problem 4, Palindromic numbers

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

6 Monate ago

Solved

Project Euler: Problem 5, Smallest multiple

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

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

6 Monate ago

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

6 Monate ago

Solved

Project Euler: Problem 3, Largest prime factor

The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

6 Monate ago

Solved

Project Euler: Problem 10, Sum of Primes

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

6 Monate ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

6 Monate 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! B...

6 Monate ago

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

6 Monate ago

Solved

Hankelize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

6 Monate ago

Solved

Matrix multiplication across rows

Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

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

6 Monate ago

Solved

Magnet and Iron

(Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/112 Problem 112: Remove the air bubbles>) Iron (atomic n...

6 Monate ago

Solved

Remove the air bubbles

Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

6 Monate ago

Solved

subtract central cross

Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

6 Monate ago

Solved

Toeplitize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

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

6 Monate ago