input => errorsequence = [10 20 21 40]
output => truesequence = [19 20 21 22] , errorposition = [1 4]
Result: Test fail
It took me a while to figure this one out. Your mathmatical intuition and ability of code implementation keep stunning me. The solution really a mind blower. Bravo!
Note that this will fail on a short sequence e.g. [10 20 21 40]
I believe changing mode to median should work in all non-ambiguous cases (length>3)
Remove all the words that end with "ain"
It dseon't mettar waht oedrr the lrettes in a wrod are.
How many trades represent all the profit?
Unique values without using UNIQUE function
Symmetry of vector
Find Elements in Range
Find the distance between runs
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office