Divya Yerraguntla
Followers: 0 Following: 0
Feeds
已解决
Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...
5 years 前
已解决
Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...
5 years 前
已解决
Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...
5 years 前
已解决
Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...
5 years 前
已解决
Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...
5 years 前
已解决
Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...
5 years 前
已解决
Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...
5 years 前
已解决
Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...
5 years 前
已解决
Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...
5 years 前
已解决
Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...
5 years 前
已解决
Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...
5 years 前
已解决
Remove the polynomials that have positive real elements of their roots.
The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the <http://www.ma...
5 years 前
已解决
Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...
5 years 前
已解决
Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
5 years 前
已解决
Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...
5 years 前
已解决
Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...
5 years 前
已解决
Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...
5 years 前
已解决
Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...
5 years 前
已解决
The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...
5 years 前
已解决
The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...
5 years 前
已解决
Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...
5 years 前
已解决
Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...
5 years 前
已解决
Find the two-word state names
Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...
5 years 前
已解决
Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...
5 years 前
已解决
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...
5 years 前
已解决
Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...
5 years 前
已解决
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...
5 years 前
已解决
Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...
5 years 前
已解决
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.
5 years 前