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 ...
Vector with a repeated entry
Create a row vector of length n, filled with 4's. For example, if n = 3,
output = [4 4 4]
Hint:
Search for the function...
Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...
6年弱 前
解決済み
How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs.
Given vector of num...
6年弱 前
解決済み
Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones.
* Find 1 0 1 and replace it with 1 1 1
* Find 0 1 0 and replace it w...
6年弱 前
解決済み
compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...
6年弱 前
解決済み
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];
...
6年弱 前
解決済み
Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...