Solved


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

ongeveer 2 jaar ago

Solved


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

ongeveer 2 jaar ago

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

ongeveer 2 jaar ago

Answered
merge two datetime arrays into one datetime arrays
There might be something more efficient but this should work: dt = datetime(strcat(string(date')," ",string(time')))

ongeveer 2 jaar ago | 0

Answered
Plot an ODE solution with different constant values.
Is this what you are looking for? clear syms y(x) ode = diff(y,x) == (1.5 - 0.8*y) / (0.5 + 0.8*x); sol = dsolve(ode); y1 =...

ongeveer 2 jaar ago | 0

| accepted

Question


Optimization problem giving inconsistent answers upon changing initial guesses
Hi, I want to solve the following optimization problem from Optimization of Chemical processes: Here is what I have done so...

ongeveer 2 jaar ago | 1 answer | 0

1

answer

Solved


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

ongeveer 2 jaar ago

Solved


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

ongeveer 2 jaar ago

Solved


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

ongeveer 2 jaar ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

ongeveer 2 jaar ago

Solved


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

ongeveer 2 jaar ago

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

ongeveer 2 jaar ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

ongeveer 2 jaar ago

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

ongeveer 2 jaar ago

Solved


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

ongeveer 2 jaar ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

ongeveer 2 jaar ago

Solved


Calculate the Levenshtein distance between two strings
This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

ongeveer 2 jaar ago

Solved


Knight's Tour Checker
Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

ongeveer 2 jaar ago

Solved


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...

ongeveer 2 jaar ago

Solved


Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

ongeveer 2 jaar ago

Solved


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...

ongeveer 2 jaar ago

Solved


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 ...

ongeveer 2 jaar ago

Solved


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...

ongeveer 2 jaar ago

Solved


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more here) asserted that readers are relatively insensitive to letter order in words, so long a...

ongeveer 2 jaar ago

Solved


Given two arrays, find the maximum overlap
Given two arrays s1 and s2, create a new array s3 which is as short as possible and contains both arrays. If s1 = [1 2 3 4 5]...

ongeveer 2 jaar ago

Solved


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...

ongeveer 2 jaar ago

Solved


Mandelbrot Numbers
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

ongeveer 2 jaar ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

ongeveer 2 jaar ago

Solved


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 roots of the p...

ongeveer 2 jaar ago

Solved


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...

ongeveer 2 jaar ago

Load more