Solved

Create a random logical vector of N elements of which M are true.

Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

4 days ago

Solved

Genome decoding

Inspired by a question on the answer forum: You are given a matrix of 8-bit integers which encodes a genome. Each integer can...

4 days ago

Solved

Parse me a Lisp

*Description* In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is ...

4 days ago

Solved

Did you say please? - Find one string within another without strfind or regexp/regexpi

For a given string sentence, determine if the string word 'please' is present or not. If so, return the string 'OK', else return...

4 days ago

Solved

Combine the first and last names

MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays o...

4 days ago

Solved

Use a timetable to analyze a train timetable (Part 1)

Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. Th...

4 days ago

Solved

Use a timetable to analyze a train timetable (Part 4)

You are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily tri...

4 days ago

Solved

Use a timetable to analyze a train timetable (Part 3)

Oh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston ...

4 days ago

Solved

Use a timetable to analyze a train timetable (Part 2)

Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. Yo...

4 days ago

Solved

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

We have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma ...

4 days ago

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

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

4 days ago

Solved

commutative?

Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

4 days ago

Solved

Set defaults

Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

4 days ago

Solved

Find the coefficients for numerical integration using Simpson's rule

For using numerical integration using Simpson's rule, we need some coefficients to be determined first. Suppose the n is the nu...

4 days ago

Solved

Tridiagonal matrix

Given vectors u and v, make a tri-diagonal symmetric matrix such that u is in the main diagonal and v is below and above diagona...

4 days ago

Solved

String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array

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

5 days ago

Solved

String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array

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

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

5 days ago

Solved

ismember: Enhanced Performance for 'rows' and width - Speed Scoring (66% savings)

The Challenge is to perform very fast the 'ismember' function for a long and wide array. The width of the array is expanded fro...

5 days ago

Solved

Remove NaNs and numbers adjacent to NaNs

The aim is to remove the elements before and after NaN occurrences inside a vector. For example: x = [6 10 5 8 9 NaN 23 1...

5 days ago

Solved

Find indices of diagonal elements

Given a matrix A and a diagonal index d (where 0 indicates the main diagonal and off-diagonals are identified by positive and n...

5 days ago

Solved

Backslang, odds are you used it at some point in time...

So backslang is a language that can be used to communicate in an easy decode code, if people know the rules of decoding it. Wel...

5 days ago

Solved

Rescaling vector

Rescale the entries of a vector x so that it spams [a,b]. The new values should be linearly stretched into the new range. _Ex...

5 days ago

Solved

Split a given string from the first instance of a given character

A simple operation to split a given string into two substrings at the point where the desired character is first found. e.g. ...

5 days ago

Solved

Replace all zeros and NaNs in a matrix with the string 'error'

Given a numeric input matrix A, possibly containing some zero values and some NaNs, replace any occurrences of zero or NaN with ...

5 days ago

Solved

Make a Pandiagonal Prime Magic Square: 11 x 11

This Fun with Primes Challenge is to create a Pandiagonal Prime Magic Square of size 11x11 given eleven APk sequences with 10 co...

5 days ago

Solved

Pandiagonal Prime Magic Square Verification

Verify if an NxN matrix is a Pandiagonal Prime Magic Square. Required properties: 1) N^2 prime values ( No repeats, 1 ...

6 days ago

Solved

Leftovers? Again?!

I am thinking of a positive number X. To determine what number I am thinking of, I will give you two 1xN vectors. The first ve...

6 days ago

Solved

Vector Linear sum: (p1-m1)V1+(p2-m2)V2+...(pK-mk)Vk

Calculate the sum of a Vector times coefficients expressed as two strings. Example: Normal representation [ a b c ], [ p1 ...

6 days ago