A résolu


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

environ 13 ans il y a

A résolu


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

environ 13 ans il y a

A résolu


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

environ 13 ans il y a

A résolu


FizzBuzz
<http://c2.com/cgi/wiki?FizzBuzzTest FizzBuzz Test> The "Fizz-Buzz test" is an interview question designed to help filter out...

environ 13 ans il y a

A résolu


linear least squares fitting
Inputs: * |f|: cell-array of function handles * |x|: column vector of |x| values * |y|: column vector of |y| values, same l...

environ 13 ans il y a

A résolu


Handle to an array of functions
Given a cell array of functions that operate on scalars, it is required to return a function handle to process a vector of value...

environ 13 ans il y a

A résolu


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

environ 13 ans il y a

A résolu


Apply a function array to an array of numbers
It is required to apply a cell array of functions to a numerical array, where the functions accept only scalar inputs. Exampl...

environ 13 ans il y a

A résolu


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

environ 13 ans il y a

A résolu


Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

environ 13 ans il y a

A résolu


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

environ 13 ans il y a

A résolu


Hangman (strategy)
What is the best strategy in a <http://en.wikipedia.org/wiki/Hangman_(game) hangman> game? Your job is to device a strategy t...

environ 13 ans il y a

A résolu


Golomb's self-describing sequence (based on Euler 341)
The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G...

environ 13 ans il y a

A résolu


Transposition as a CIPHER
This all about transcripting a text message. If the input string is: *s1 = 'My name is Sourav Mondal'*, then the output is: *s2...

environ 13 ans il y a

A résolu


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

environ 13 ans il y a

A résolu


The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

environ 13 ans il y a

A résolu


distance between two points
compute distance between two points,where it is in Cartesian, Polar or Spherical coordinates.

environ 13 ans il y a

A résolu


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

environ 13 ans il y a

A résolu


2D - Mean Filter
Assume you are given an "image" matrix of size NxM. Reduce the image noise by implementing a mean filter window of size 9 (a 3x3...

environ 13 ans il y a

A résolu


Hangman (easy)
What is the best letter to start a <http://en.wikipedia.org/wiki/Hangman_(game) hangman> game with? You are given a cell arra...

environ 13 ans il y a

A résolu


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

environ 13 ans il y a

A résolu


Wheat on a chessboard pt 2
If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successiv...

environ 13 ans il y a

A résolu


Wheat on a chessboard pt 1
If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successi...

environ 13 ans il y a

A résolu


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

environ 13 ans il y a

A résolu


Happy 2013...
Happy 2013, everyone! An interesting tidbit about 2013 is that it is the first year since 1987 to contain four different digits...

environ 13 ans il y a

A résolu


Coin Tossing: Probability of Same Heads for N tosses
A pair of physicists toss a coin n times each. What is the probability that they tossed the same number of heads? *Input:*...

environ 13 ans il y a

A résolu


Sum the elements in either diagonal of a square matrix
Sum the elements of a square matrix that lie on either the major diagonal or anti-diagonal.

environ 13 ans il y a

A résolu


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

environ 13 ans il y a

A résolu


Generate pi using logarithm
Generate pi using logarithm

environ 13 ans il y a

A résolu


Calculate Alcohol By Volume with Original and Final Gravity
Given an initial gravity of un-fermented wort (OG) and a final gravity of fermented wort (FG), better known as beer, it is possi...

environ 13 ans il y a

Charger plus