First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...
2ヶ月 前
解決済み
Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_.
Note: NaNs are equal and there may be n...
Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...
2ヶ月 前
解決済み
Special matrix
Make a square matrix with this shape. For n=4
M =
1 1 0 0
1 0 1 0
0 1 0 ...
2ヶ月 前
解決済み
Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3,
Y = [1 2 3;
...
2ヶ月 前
解決済み
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use d...
3ヶ月 前
解決済み
Symmetric matrix
You must create a n-by-n symmetric matrix such that A(row,col) = row/col for col >= row.
Example if n =3 :
output is : A =
...
3ヶ月 前
解決済み
Pascal's Matrix
Given an integer n ≥ 0, generate the ( _n_+1) × ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...