A student of Electrical and Electronic Engineering

Solved

Create a block diagonal matrix

A block diagonal matrix is a square matrix that can be written as A = [a 0 0 0 0 b 0 0 0 0 c 0 ...

6 months ago

Solved

Generate this matrix

For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

6 months ago

Solved

Check if a rotated array was originally sorted

Suppose a sorted array is rotated at some pivot unknown to you. For example, |[0 1 2 4 5 6 7]| might become |[5 6 7 0 1 2 4]|. ...

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

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

6 months ago

Solved

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

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

6 months ago

Solved

Trickier Timing

You solution should return control to main program only when the current time ends in either a 5 or 0 (e.g. the current seconds ...

6 months ago

Solved

Look Up Mapping

Let the input is A = {[] [] [] [1] []}; B = {'A','B','C','D','E'}; Mapped Output = 'D';

6 months ago

Solved

Chess probability

The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

6 months ago

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

6 months ago

Solved

Make a diamond

Given n, odd number > 1, return n by n matrix consist of "null" and "*" characters arranged like a diamond. No toolbox funct...

6 months ago

Solved

Subtract two positive numbers

Given a and b as a string, return b-a without using string to number conversion functions. a and b must to be a same size and b ...

6 months ago

Solved

Prime Time

All you need to do here is submit your solution a prime number of seconds after the top of the hour. Any hour at all... Easy, ...

6 months ago