Risolto

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

11 mesi fa

Risolto

Reverse Run-Length Encoder

Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

11 mesi fa

Risolto

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

11 mesi fa

Risposto

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')))

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')))

11 mesi fa | 0

Risposto

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

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

11 mesi fa | 0

| accettato

Domanda

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

11 mesi fa | 1 risposta | 0

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

Quote Doubler

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

Pangrams!

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

12 mesi fa

Risolto

Determine if input is odd

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

12 mesi fa

Risolto

Nearest Numbers

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

Calculate the Levenshtein distance between two strings

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

Kaprekar Steps

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

Mandelbrot Numbers

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

12 mesi fa

Risolto

Prime factor digits

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

12 mesi fa

Risolto

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

12 mesi fa

Risolto

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

12 mesi fa