Check if any duplicates in your data
Given an array x, return a number n equal to the largest number of repetitions in your data.
For example:
If x=[1 2 3 6 8 4 9]...
Convert Kilometers to Miles
Convert kilometers to miles. Consider 1 km = 0.62 mile.
Note: Don't use the '*' operator.
3年以上 前
解決済み
Find the mode of the given input
Find the statistical <http://en.wikipedia.org/wiki/Mode_(statistics)/ mode>
of the given input.
Example:
If X is matr...
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false.
Example...
3年以上 前
解決済み
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
3年以上 前
解決済み
Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...
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...
3年以上 前
解決済み
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.
3年以上 前
解決済み
Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...
Approximate functions 1 (★★★)
Compute the following sum for any given x and positive integer n.
<<https://i.imgur.com/eUwXdSE.gif>>
<>
Here m! denote...
3年以上 前
解決済み
Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.
3年以上 前
解決済み
Replicate elements in vectors (★★★)
(copy of Prob 867)
Replicate each element of a row vector (with NaN) a constant number of times. Examples
n=2, A=[1 2...