Solved

Use R2016b Text Manipulations to Fix These Addresses (Part 2)

We have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Mass...

3 Monate ago

Solved

Use R2016b Text Manipulations to Fix These Addresses (Part 1)

We have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the...

3 Monate ago

Solved

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

4 Monate ago

Solved

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

4 Monate ago

Solved

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

4 Monate ago

Solved

Return unique values without sorting

If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

4 Monate ago

Solved

First non-zero element in each column

For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

4 Monate ago

Solved

Generate N equally spaced intervals between -L and L

Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

4 Monate ago

Solved

We love vectorized solutions. Problem 1 : remove the row average.

Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

4 Monate ago

Solved

Split a string into chunks of specified length

Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

4 Monate ago

Solved

Convert a numerical matrix into a cell array of strings

Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

4 Monate ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

4 Monate ago

Solved

Convert a Cell Array into an Array

Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

4 Monate ago

Solved

Cell Counting: How Many Draws?

You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

4 Monate ago

Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

4 Monate ago

Solved

Remove element(s) from cell array

You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

4 Monate ago

Solved

String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

4 Monate ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

4 Monate ago

Solved

Create a cell array out of a struct

Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

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

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

4 Monate ago

Solved

Remove all the consonants

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

4 Monate ago

Solved

Remove the vowels

Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

4 Monate ago

Solved

Summing Digits within Text

Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

4 Monate ago

Solved

Elapsed Time

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

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

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

4 Monate ago

Solved

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

4 Monate ago

Solved

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

4 Monate ago

Solved

Fibonacci-Sum of Squares

Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

4 Monate ago