Gelöst


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

mehr als 13 Jahre vor

Gelöst


edge detection
write a function that gives the indexes of rising or falling edge x is a vector (assume it contains always at least one eleme...

mehr als 13 Jahre vor

Gelöst


Find the repeating decimal pattern!
Write a function that takes one double input value and returns only the repeating decimal, if any, as a string. Only decimals f...

mehr als 13 Jahre vor

Gelöst


Volume of a Parallelepiped
Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

mehr als 13 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 =...

mehr als 13 Jahre vor

Gelöst


Find the Kronecker Tensor Product without using KRON
The Kronecker Tensor Product is the result of multiplying all elements of a matrix with each of the elements of another matrix. ...

mehr als 13 Jahre vor

Gelöst


function on a moving window
Create a function that applies an operation (such as @sum, @mean, @std, @norm etc) to a moving window of the data. First exam...

mehr als 13 Jahre vor

Gelöst


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

mehr als 13 Jahre vor

Gelöst


Make a function that returns its own character count
Write a function that returns a 128 element vector with an accurate inventory of the ASCII characters in its own function file. ...

mehr als 13 Jahre vor

Gelöst


Parse string and identify specific string sequence in algebraic equation
Given a string S that defines an algebraic expression such as: S= 'X= A1 + A2*(Y1 + A3*Y3)*exp( A4*Y12 + Y1) ;' return a...

mehr als 13 Jahre vor

Gelöst


Fizz Buzz
Given an array of positive, non-zero, integers, return a cell array of strings the same size as the input, where each element in...

mehr als 13 Jahre vor

Gelöst


What are the odds?
Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should ...

mehr als 13 Jahre vor

Gelöst


deconvolution
* Suppose there is a vector v like [1 0 0 -1], representing polynomial coefficients. * In this example, the polynimial is 1*x^3...

mehr als 13 Jahre vor

Gelöst


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

mehr als 13 Jahre vor

Gelöst


count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...

mehr als 13 Jahre vor

Gelöst


What digit is it?
The function you are being asked to write will take three numbers (n,x,q) as input. The object of the function is to determine ...

mehr als 13 Jahre vor

Gelöst


Create a dictionary
The goal is to write a function that returns a dictionary from a list of words or phrases and their definitions. Here is an exam...

mehr als 13 Jahre vor

Gelöst


Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

mehr als 13 Jahre vor

Gelöst


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

mehr als 13 Jahre vor

Gelöst


Kaprekar numbers
Test if the input is a Kaprekar number: <http://mathworld.wolfram.com/KaprekarNumber.html>. Return a logical true or false. ...

mehr als 13 Jahre vor

Gelöst


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

mehr als 13 Jahre vor

Gelöst


Number of Horns on a unicorn!
Calculate the number of horns on a *unicorn*! And I'm talking about a unicorn with not more than one horn on it!

mehr als 13 Jahre vor

Gelöst


Wilf-Zeilberger pairs
Take as inputs two functions _F_ and _G_, and two scalar values _n_ and _k_. Test whether the functions are candidates to be a W...

mehr als 13 Jahre vor

Gelöst


Figurate number triangle
Check whether the input matrix is a figurate number triangle: <http://mathworld.wolfram.com/FigurateNumberTriangle.html>

mehr als 13 Jahre vor

Gelöst


Equidistant numbers containing certain value in an interval
Given a lower and upper bound of an interval, distance between numbers, and one particular number from that interval, create an ...

mehr als 13 Jahre vor

Gelöst


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

mehr als 13 Jahre vor

Gelöst


Minefield Sonar
*Background* In mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left c...

mehr als 13 Jahre vor

Gelöst


Filter values in a vector
Cody often benefits from a functional style of programming. For example, your score is often better when you compose multiple fu...

mehr als 13 Jahre vor

Gelöst


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

mehr als 13 Jahre vor

Gelöst


Check to see if a Sudoku Puzzle is Solved
*Description:* Your task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integer...

mehr als 13 Jahre vor

Mehr laden