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...
約7年 前
解決済み
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
約7年 前
回答済み Cutting of sampled signal into two parts
Dear Rasheed Asad,
There are several ways to do that:
(1) You can use fast fourier transform (FFT)
(2) You can use short t...
約7年 前 | 1
| 採用済み
解決済み
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
約7年 前
解決済み
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
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 + ...
約7年 前
解決済み
Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
約7年 前
解決済み
Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...
約7年 前
解決済み
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...
約7年 前
解決済み
Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
約7年 前
解決済み
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x.
For instance if x=2 then y must be 1+2+3+4=10.
約7年 前
解決済み
Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...
約7年 前
解決済み
Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...