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 ...
1년 이상 전
해결됨
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...
Return unique values without sorting
If the input vector A is [42 1 1],
the output value B must be the unique values [42 1]
The *values of B are in the s...
Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...
Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...
1년 이상 전
해결됨
Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector.
For example:
x = [6 10 5 8 9 NaN 23 9 7 3 21 ...
1년 이상 전
해결됨
Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g.
x = [0 5; 10 3; 20 15; 16 19; 25 25]
contains...