I'm just this guy, you know

Solved

Toeplitize a matrix

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

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

11 days ago

Solved

Hankelize a matrix

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

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

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

11 days ago

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

11 days ago

Solved

Magnet and Iron

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

11 days ago

Solved

Replace Nonzero Numbers with 1

Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

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

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

11 days ago

Solved

Convert matrix to 3D array of triangular matrices

Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

11 days ago

Solved

Too Many Zeros, Dump Them!

Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

11 days ago

Solved

Enlarge array

Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

11 days ago

Solved

Remove entire row and column in the matrix containing the input values

Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

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

12 days 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] ...

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

12 days ago

Solved

Make a vector of prime numbers

Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

18 days ago

Solved

Circular Primes (based on Project Euler, problem 35)

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

18 days ago

Solved

Mersenne Primes vs. All Primes

A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

18 days ago

Solved

Return fibonacci sequence do not use loop and condition

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: ...

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

18 days ago

Solved

Get all prime factors

List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

18 days ago

Solved

Proper Factors

Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

18 days ago

Solved

Multiples of a Number in a Given Range

Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

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

18 days ago

Solved

Great Circle Distance

Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphe...

18 days ago

Solved

Smallest distance between a point and a rectangle

Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

19 days ago

Solved

Clockwise or Counterclockwise

Given a list of 2-d points defining the vertices of a polygon, determine whether these points are sorted clockwise. The input...

19 days ago