已解决


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

14 years 前

已解决


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

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

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

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

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

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

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

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

14 years 前

已解决


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

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

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

14 years 前

已解决


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

14 years 前

已解决


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

14 years 前

已解决


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

14 years 前

已解决


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

14 years 前

已解决


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

14 years 前

已解决


Volume difference between Ellipsoid and Sphere
Given an ellipsoid of semi principal axis (a,b,c) find the volume of the difference between this ellipsoid and the sphere with...

14 years 前

已解决


Compression: Encode and Decode
This Challenge is to compress an array created by randi(2^32-1,1000) and then decompress your data file. The first call will ...

14 years 前

已解决


Generate pi using logarithm
Generate pi using logarithm

14 years 前

已解决


USC Fall 2012 ACM: Rover Maze
This Challenge is to solve Question F, Martian Pits, of the <http://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Cont...

14 years 前

已解决


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

14 years 前

已解决


Property dispute!
Two neighbors have rectangular plots of land A and B. The surveyors give you the coordinates of each. If they overlap, there is ...

14 years 前

已解决


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

14 years 前

已解决


Crossing to Kissing - Untangle the Lines
Turn lines that cross into lines that kiss. You will be given two lines that cross at some point. Your job is to untangle the...

14 years 前

已解决


String permutations on phone keyboard
Given a number such as 2639 return all possible string permutations using the phone-keyboard on <http://www.mathworks.com/matlab...

14 years 前

已解决


Find out missing number from a vector of 9 elements
You are given a vector of size 9, x = [x1 x2 x3 x4 x5 x6 x7 x8 x9] Elements of x may be randomly selected without repeati...

14 years 前

已解决


Raise Matrix to Power
For a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.

14 years 前

已解决


Visualization of experimental data across a surface
Assume that you have taken data across the surface of a sample, for example sheet resistance. The data is stored in a Nx3 matri...

14 years 前

已解决


USC Fall 2012 ACM: Driving the Rover
This Challenge is to solve Question E, Driving the Rover, of the <http://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012...

14 years 前

加载更多