已解决


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

13 years 前

已解决


Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...

13 years 前

已解决


Non-zero bits in 10^n.
Given an integer that is a power of 10, find the number of non-zero bits, k, in its binary representation. For example: * ...

13 years 前

已解决


Join Strings with Multiple Different Delimiters
The idea is to form the string S by interleaving the elements of a cell array of strings DELIMITER and another cell array of st...

13 years 前

已解决


Flexible Anonymous Function
Given a function handle, return a handle to a function that would accept an arbitrary number of inputs, applies the function to ...

13 years 前

问题


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

13 years 前 | 3 | 15 个解题者

已解决


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

13 years 前

已解决


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.

13 years 前

问题


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

13 years 前 | 2 | 53 个解题者

已解决


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

13 years 前

已解决


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×...

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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.

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

已解决


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

13 years 前

加载更多