Risolto


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

oltre 10 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

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

oltre 10 anni fa

Risolto


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

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

oltre 10 anni fa

Risolto


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

oltre 10 anni fa

Risolto


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

oltre 10 anni fa

Risolto


Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

oltre 10 anni fa

Risolto


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

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

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

oltre 10 anni fa

Risolto


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

oltre 10 anni fa

Risolto


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

oltre 10 anni fa

Risolto


only input
Return the output without writing any code into the function.

oltre 10 anni fa

Risolto


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

oltre 10 anni fa

Risolto


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

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

oltre 10 anni fa

Risolto


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

oltre 10 anni fa

Risolto


radius of a spherical planet
you just measured its surface area, that is the input.

oltre 10 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 =...

oltre 10 anni fa

Risolto


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

oltre 10 anni fa

Risolto


surface of a spherical planet
you just discovered its circumference, that is the input.

oltre 10 anni fa

Risolto


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

oltre 10 anni fa

Risolto


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

oltre 10 anni fa

Risolto


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

oltre 10 anni fa

Risolto


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

oltre 10 anni fa

Risolto


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (http://en.wikipedia.org...

oltre 10 anni fa

Risolto


Return area of square
Side of square=input=a Area=output=b

oltre 10 anni fa

Carica altro