Solved


Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

10 years ago

Solved


Find the right x in a 1. order Polynomal (y = m*x+c)
Given two points in a Cartesian coordinate system, find the x-value, where polynomial of 1. order (y = m*x+c) is equal to a giv...

10 years ago

Solved


Accessing values in a cell
You are given c, which is a 1xN cell array, and a and b, which are each two 1xM vectors. Your job is to give the bth value in t...

10 years ago

Solved


Full combinations
Given n input vectors x1, x2, …, xn, generate a p*n matrix y whose rows contain all element-wise combinations of the vectors x1,...

10 years ago

Solved


How many ways to write a number
Given two positive numbers n and k, where n>=k.In how many ways can we write n as sum of k positive numbers.Same numbers but dif...

10 years ago

Solved


the "power matrix" of two vetcors
Given two row vectors x,y of lengths m and n (resp.), create an m x n matrix whose i,j entry is x(i)^y(j).

10 years ago

Solved


Raise a polynomial to a power
In Matlab, polynomials are represented by a vector of coefficients. For example, the polynomial p=a*x^2 + b*x + c is represente...

10 years ago

Solved


GJam March 2016 IOW: Clock Dance
This Challenge is derived from <http://code.google.com/codejam/contest/8274486/dashboard#s=p1 GJam March 2016 Annual I/O for Wom...

10 years ago

Solved


Zelda - Rupee Count (Item Purchase)
Building off of <https://www.mathworks.com/matlabcentral/cody/problems/3025-zelda-rupee-count Problem 3025>, suppose that an arr...

10 years ago

Solved


Zelda - Rupee Count (Compact)
Building off of <https://www.mathworks.com/matlabcentral/cody/problems/3025-zelda-rupee-count Problem 3025>, suppose that Link's...

10 years ago

Solved


Zelda - Rupee Count
Rupees are the main currency in The Legend of Zelda games. The value of each rupee is determined by its color. Unfortunately, th...

10 years ago

Solved


Letter and word frequency
Here is a task: You’re given a text file. Your first task is to create a variable in MATLAB which will hold the text given to...

10 years ago

Solved


Net Present Value of a Stream of Cash Flows
Calculate <https://en.wikipedia.org/wiki/Present_value the net present value of a future cash flow> vector given; * future ca...

10 years ago

Solved


Create array of all Distances between two Sets of Points
This Challenge is a subsection of <http://www.mathworks.com/matlabcentral/cody/problems/1110-usc-fall-2012-acm-martian-pranks Ma...

10 years ago

Solved


GJam 2014 China Rd B: Sudoku Checker
This Challenge is derived from <http://code.google.com/codejam/contest/2929486/dashboard#s=p0 GJam 2014 China Sudoku>. Large Cas...

10 years ago

Solved


Fletcher-Reeves Conjugate Gradient Method
Write a function to find the values of a design variable vector, _x_, that minimizes an unconstrained scalar objective function,...

10 years ago

Solved


Create formatted value string Cell array of a vector
This Challenge is to create a cell array that contains strings of vector components in a given format. c=vector2formattedstri...

10 years ago

Solved


GJam March 2016 IOW: Cody's Jams
This Challenge is derived from <http://code.google.com/codejam/contest/8274486/dashboard GJam March 2016 Annual I/O for Women Co...

10 years ago

Solved


Unique: Faster for options 'rows' and 'stable' for large array of uint8
Challenge: Execute unique(a,'rows','stable') Faster for 'a' being uint8. The "unique" function for the 'rows' and 'stable' o...

10 years ago

Solved


Big numbers, least significant digits
Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

10 years ago

Solved


Tribute to Ramanujan
The nth taxicab number, denoted as T(n), is defined as the smallest number that can be expressed as a sum of two positive algebr...

10 years ago

Solved


Mystery problem
Given integer x between 1 and 50, return integer y=mystery(x), where mystery(1) = 111 mystery(6) = 809 ... mystery...

10 years ago

Solved


Go-style solver
Consider a variation of the game Go where one player has gone ahead and placed several pieces all at once. Assuming that the sec...

10 years ago

Solved


Bleed non-zeros to the right using REGEXP, and that sort of cheatcodess...
This one is quite similar to <http://www.mathworks.nl/matlabcentral/cody/problems/1998-bleed-non-zeros-to-the-right>. But thi...

10 years ago

Solved


Functional inputs
Return an n-dimensional array whose elements are the results of a function over a set of vectors. The (i,j,k, ...n)th element...

10 years ago

Solved


Is 3D point set Co-Planar?
This Challenge is to determine if four 3D integer points are co-planar. Given a 4x3 matrix representing four x,y,z integer poin...

10 years ago

Solved


Placing Beads Neatly in a Box
You are given a string of n black and white beads. Your job is to pack them neatly into a square box. "Neatly" in this case mean...

10 years ago

Solved


Fun with a compass
Each night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometr...

10 years ago

Solved


Is my wife really right?
For every input, output the string 'yes' once. Example: [yes1, yes2] = YesSheIs('Am I right?', 'Do you love me?') yes1 = '...

10 years ago

Solved


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

10 years ago

Load more