已解决

Remove the small words from a list of words.

Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

3 years 前

已解决

Prime factor digits

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

3 years 前

已解决

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

3 years 前

已解决

Connect Four Win Checker

<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

3 years 前

已解决

Counting Sequence

Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

3 years 前

已解决

De-primed

Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

3 years 前

已解决

With apologies to William Blake

Coder Coder, typing fast Sitting at your desk, aghast. What immortal MATLAB script will solve this problem, nice and qu...

3 years 前

已解决

Evened up (or not)

You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

3 years 前

已解决

Power Times (of the day)

Many times throughout the day can represent mathematical equations. In this problem, we focus on times that represent powers. Fo...

3 years 前

已解决

Bit calculation

Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...

3 years 前

已解决

Mysterious digits operation (easy)

What is this digit operation? 0 -> 0 1 -> 9 121 -> 9 44 -> 6 15 -> 5 1243 -> 7 ...

3 years 前

已解决

What is the next step in Conway's Life?

Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

3 years 前

已解决

Implement a ROT13 cipher

Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...

3 years 前

已解决

Sums with Excluded Digits

Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

3 years 前

已解决

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

3 years 前

已解决

Find MPG of Lightest Cars

The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...

3 years 前

已解决

Longest run of consecutive numbers

Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

3 years 前

已解决

Rescale Scores

Each column (except last) of matrix |X| contains students' scores in a course assignment or a test. The last column has a weight...

3 years 前

已解决

Calculate Inner Product

Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

3 years 前

已解决

Find the Best Hotels

Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

3 years 前

已解决

Plot Damped Sinusoid

Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

3 years 前

已解决

Crop an Image

A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

3 years 前

已解决

Calculate BMI

Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

3 years 前

已解决

Calculate a Damped Sinusoid

The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...

3 years 前

已解决

Solve a System of Linear Equations

*Example*: If a system of linear equations in _x₁_ and _x₂_ is: 2 _x₁_ + _x₂_ = 2 _x₁...

3 years 前

已解决

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

3 years 前

已解决

Find the Oldest Person in a Room

Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

3 years 前

已解决

Convert from Fahrenheit to Celsius

Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

3 years 前

已解决

Calculate Amount of Cake Frosting

Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

3 years 前

已解决

Kaprekar Steps

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

3 years 前