Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ .
Example:
n=5
ans=
[1 1 1 1 1
0 0 0 1 ...
5ヶ月 前
解決済み
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ヶ月 前
解決済み
Draw 'I'
Given n as input, draw a n-by-n matrix 'I' using 0 and 1.
example:
n=3
ans=
[0 1 0
0 1 0
0 1 0]
n=...
5ヶ月 前
解決済み
Set a diagonal
Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...
5ヶ月 前
解決済み
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ヶ月 前
解決済み
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...
Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...
5ヶ月 前
解決済み
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];
...
Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists.
x = [2 6 4 9 -10 3 1 5 -10];
So
...
5ヶ月 前
解決済み
Oh Zero Zero Zero!!!
Hello all,
So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...