Feeds
已解决
Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...
12 hours 前
已解决
Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...
12 hours 前
已解决
MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9
12 hours 前
已解决
count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...
12 hours 前
已解决
Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...
12 hours 前
已解决
Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...
12 hours 前
已解决
Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...
12 hours 前
已解决
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...
12 hours 前
已解决
the average value of the elements
Calculate the average value of the elements in the array
12 hours 前
已解决
Find the sides of an isosceles triangle when given its area and height from its base to apex
Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and h=...
12 hours 前
已解决
Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...
12 hours 前
已解决
Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas: 1 kilogram = 2.2 pounds 1 inch = 2...
12 hours 前
已解决
Find the Best Hotels
Given three input variables: hotels - a list of hotel names ratings - their ratings in a city cutoff - the rating at which yo...
12 hours 前
已解决
Sum of series IX
What is the sum of the following sequence: Σ 1/k! for k=1...n for different n?
12 hours 前
已解决
MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8
12 hours 前
已解决
Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. Slightly harder than it seems like it should be. Exampl...
12 hours 前
已解决
Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...
12 hours 前
已解决
Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...
12 hours 前
已解决
Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...
12 hours 前
已解决
Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.
12 hours 前
已解决
GJam: 2013 China Event: Cannon Angle
This Challenge is derived from <http://code.google.com/codejam/contest/2933486/dashboard#s=p1 GJam 2013 China Captain Hammer>. T...
12 hours 前
已解决
Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...
12 hours 前
已解决
The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
13 hours 前
已解决
Get the length of a given vector
Given a vector x, the output y should equal the length of x.
13 hours 前
已解决
Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...
13 hours 前
已解决
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
13 hours 前
已解决
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...
13 hours 前
已解决
Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...
13 hours 前
已解决
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...
13 hours 前
已解决
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 + ...
13 hours 前
