Risolto


DC chopper
Input x is the sampled signal vector, may have both AC and DC components. output vector y should have AC components removed then...

circa 12 anni fa

Risolto


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

circa 12 anni fa

Risolto


Least common multiple of many numbers
1:6 -> 60

circa 12 anni fa

Risolto


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

circa 12 anni fa

Risolto


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

circa 12 anni fa

Risolto


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

circa 12 anni fa

Risolto


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

circa 12 anni fa

Risolto


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

circa 12 anni fa

Risolto


Mandelbrot Numbers
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

circa 12 anni fa

Risolto


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

circa 12 anni fa

Risolto


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

circa 12 anni fa

Risolto


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

circa 12 anni fa

Risolto


Subset Sum
Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

circa 12 anni fa

Risolto


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

circa 12 anni fa

Risolto


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

circa 12 anni fa

Risolto


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

circa 12 anni fa

Risolto


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

circa 12 anni fa

Risolto


What is the next step in Conway's Life?
Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

circa 12 anni fa

Risolto


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

circa 12 anni fa

Risolto


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

circa 12 anni fa

Risolto


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

circa 12 anni fa

Risolto


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

circa 12 anni fa

Risolto


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

circa 12 anni fa

Risolto


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

circa 12 anni fa

Risolto


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

circa 12 anni fa

Risolto


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

circa 12 anni fa

Risolto


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

circa 12 anni fa

Risolto


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

circa 12 anni fa

Risolto


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

circa 12 anni fa

Risolto


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

circa 12 anni fa

Carica altro