Solved

last n digit of a power function

Calculate the power of a given a base, exponent. Return the last n digit number. Example 1: base = 3; expo = 8; n = 3; ...

casi 7 años ago

Solved

Leap Year

According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...

casi 7 años ago

Solved

Simple Past of Regular Verbs

Given a regular verb, return the simple past. Example Input verb = 'to work' Output simple_past = 'worked'

casi 7 años ago

Solved

Permutation

How many different words can be formed using all the letters(together) from a given input word? Input is a string.

casi 7 años 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. ...

casi 7 años ago

Solved

Reverse within string

If input is a string 'yellow' the output should be 'leywol'. Locate the middle of the string and reverse the first (yel) and sec...

casi 7 años ago

Solved

Make blocks of color

Given a (Nx3) sequence of RGB colors, I want to create a (numRowBlocks x numColBlocks x 3) image comprising (blockSize x blockSi...

casi 7 años ago

Solved

Compute the dilation of a binary image

A basic operation in image analysis is the dilation. Given an image where each pixel is either on or off (black/white, true/fals...

casi 7 años ago

Solved

N-Dimensional Array Slice

Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

casi 7 años ago

Solved

Make a logical diamond using GALLERY function

Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/1078-make-a-diamond Problem 1078. Make a diamond> In thi...

casi 7 años ago

Solved

Change a specific color in an image

The ability to change colors can be a useful tool in image processing. Given an m x n x 3 array (much like CData in images), fin...

casi 7 años ago

Solved

Angles of the hands of a clock

For this problem, consider an analog (or at least continuous digital representation) of a clock. Our clock is a 12 hour clock w...

casi 7 años ago

Solved

Sum of the pixel values for the blue color

Calculate the sum of the pixel values for the blue color, with a picture as an input. *NOTE:* The picture will be provided as...

casi 7 años ago

Solved

Molecule Atomic Wt (CHONS) Molecules

Given a molecular equation string determine its atomic weight. Limited atoms of C H O N and S where wts are rounded to [12 1 ...

casi 7 años ago

Solved

Math with Roman Numerals

Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

casi 7 años ago

Solved

Convert Roman to Arabic Numerals

Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

casi 7 años ago

Solved

Convert a number to its Roman representation

Convert a given number to its Roman representation. For example, if the number is 98, it should display 'XCVIII'

casi 7 años ago

Solved

Mimic foldl in functional programming

Mimic the higher-order function |foldl| ( <http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29 Wikipedia:Fold (higher-...

casi 7 años ago

Solved

Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.

For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1...

casi 7 años ago

Solved

Oh Zero Zero Zero!!!

Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

casi 7 años ago

Solved

Find and replace the zero array in a matrix

Find the zero array in the matrix and replace it with average of surrounding (adjacent) arrays. Example: A = 3 ...

casi 7 años ago

Solved

Slicing the cube

A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

casi 7 años ago

Solved

Count letters occurence in text, specific to words with a given length.

Build a function with two input arguments: a string and a word length (number of letters), that outputs a vector of counts of th...

casi 7 años ago

Solved

Complex transpose

Calculate the transpose of a matrix having complex numbers as its elements without changing the signs of the imaginary part. ...

casi 7 años ago

Solved

Hangman (easy)

What is the best letter to start a <http://en.wikipedia.org/wiki/Hangman_(game) hangman> game with? You are given a cell arra...

casi 7 años ago

Solved

Find the coefficient of a number in scientifc notation

Given a non-negative real number N, find the coefficient C and the exponent E of its scientific notation (N = C 10^E). Note that...

casi 7 años ago

Solved

Create a patchwork matrix

This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

casi 7 años ago

Solved

Rainbow matrix

Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

casi 7 años 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...

casi 7 años ago

Solved

Sum of digit range

Example: If A is n1, and B is n2 digit positive numbers. A*B's digit range will be [c d] (c = min & d = max). Then return ...

casi 7 años ago