Problème


Mystery problem
Given integer x between 1 and 50, return integer y=mystery(x), where mystery(1) = 111 mystery(6) = 809 ... mystery...

plus de 13 ans il y a | 3 | 15 solveurs

A résolu


Mystery problem
Given integer x between 1 and 50, return integer y=mystery(x), where mystery(1) = 111 mystery(6) = 809 ... mystery...

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

plus de 13 ans il y a

Problème


Mean ignoring NaNs
Define a function that behaves in the same way as mean(x) and mean(x,d) except that it ignores NaNs (unless all of the values be...

plus de 13 ans il y a | 2 | 53 solveurs

A résolu


Mean ignoring NaNs
Define a function that behaves in the same way as mean(x) and mean(x,d) except that it ignores NaNs (unless all of the values be...

plus de 13 ans il y a

A résolu


Diophantine Equations (Inspired by Project Euler, problem 66)
Consider the quadratic Diophantine equation of the form: x^2 – Dy^2 = 1 When D=13, the minimal solution in x is 6492 – 13×...

plus de 13 ans il y a

A résolu


What gear ratio does the cyclist need?
A cyclist (perhaps including our famed Codysolver the cyclist <http://www.mathworks.com/matlabcentral/cody/players/1841757-the...

plus de 13 ans il y a

A résolu


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

plus de 13 ans il y a

A résolu


Two-output anonymous function?
Return a function handle that when applied to an input, it produces two outputs: the first is the same as the input, and the sec...

plus de 13 ans il y a

A résolu


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

plus de 13 ans il y a

A résolu


Angles of the hands of a clock
For this problem, consider an analog (or at least continuous digital representation) of a clock. Our clock is a 12 hour clock w...

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

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

plus de 13 ans il y a

A résolu


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

plus de 13 ans il y a

A résolu


Numerical Integration
Input * |x0|, a real number greater than 0 Output * |I|, a numerical estimate of the integral x0 / I...

plus de 13 ans il y a

A résolu


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

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

plus de 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] ...

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

plus de 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:*...

plus de 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: ...

plus de 13 ans il y a

A résolu


Go-style solver
Consider a variation of the game Go where one player has gone ahead and placed several pieces all at once. Assuming that the sec...

plus de 13 ans il y a

A résolu


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

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

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

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

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

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

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

plus de 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:*...

plus de 13 ans il y a

Charger plus