Risolto


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

oltre 4 anni fa

Risolto


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

oltre 4 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 4 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 4 anni fa

Risolto


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

oltre 4 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 4 anni fa

Risolto


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

oltre 4 anni fa

Risolto


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

oltre 4 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 4 anni fa

Risolto


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

oltre 4 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 4 anni fa

Risolto


Extra safe primes
Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

oltre 4 anni fa

Risolto


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

oltre 4 anni fa

Problema


Rescale Scores
Each column (except last) of matrix |X| contains students' scores in a course assignment or a test. The last column has a weight...

oltre 4 anni fa | 47 | 5617 risolutori

Problema


Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

oltre 4 anni fa | 41 | 6551 risolutori

Problema


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

oltre 4 anni fa | 139 | 15872 risolutori

Problema


Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

oltre 4 anni fa | 67 | 8324 risolutori

Problema


Convert from Fahrenheit to Celsius
Given an input vector F containing temperature values in Fahrenheit, return an output vector C that contains the values in Celsi...

oltre 4 anni fa | 101 | 21592 risolutori

Problema


Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...

oltre 4 anni fa | 176 | 22637 risolutori

Problema


Find the Best Hotels
Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

oltre 4 anni fa | 60 | 7231 risolutori

Problema


Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. The element values ...

oltre 4 anni fa | 110 | 6597 risolutori

Problema


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the rolls is likely to be close to the expected value of a sin...

oltre 4 anni fa | 144 | 9451 risolutori

Problema


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.&#8519;^(-&lambda;t).cos(2πft)| Given inputs &lambda; ( |lambda...

oltre 4 anni fa | 55 | 8665 risolutori

Problema


Solve a System of Linear Equations
Given a constant input angle &theta;(theta) in radians, create the coefficient matrix(A) and constant vector(b) to solve the giv...

oltre 4 anni fa | 77 | 10789 risolutori

Problema


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue dashed line of |y| versus |t|. Mark the minimum value |m| of the...

oltre 4 anni fa | 66 | 7983 risolutori

Risolto


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

oltre 4 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 4 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. Examp...

oltre 4 anni fa

Risolto


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

oltre 4 anni fa

Risolto


Breaking Out of the Matrix
Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

oltre 4 anni fa

Carica altro