Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...
Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix.
example:
n=3
y=[1 0 1
0 1 0
1 0 1]
n=4
y=[1 0 0...
5 years ago
Solved
Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 .
Example:
n=5
ans=
[1 0 0 0 1
1 1 0 0 1
1 0 ...
5 years ago
Solved
~~~~~~~ WAVE ~~~~~~~~~
|The WAVE generator|
Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...
5 years ago
Solved
Decimation - Optimized for speed
This problem is similar to http://www.mathworks.com/matlabcentral/cody/problems/1092-decimation, only this time the score will b...
5 years ago
Solved
Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...
5 years ago
Solved
Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima.
For example,
x= [1 12 3 2 7 0 3 1 19 7];
...
5 years ago
Solved
Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000
e.g. x = 12,358,466,243 --> y = 12,358,470,000
5 years ago
Solved
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346
5 years ago
Solved
Numbers spiral diagonals (Part 2)
Inspired by Project Euler n°28 and 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the righ...