Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
約5年 前
解決済み
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...
約5年 前
解決済み
Summing Digits within Text
Given a string with text and digits, add all the numbers together.
Examples:
Input str = '4 and 20 blackbirds baked in a...
約5年 前
解決済み
Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...
約5年 前
解決済み
Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...
約5年 前
解決済み
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once.
Example:
Input s ...
5年以上 前
解決済み
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false.
E...