Solved

Rotate a Matrix

Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

6 months ago

Solved

Random Problem14 - Multiply a vector by a scalar of 2

Multiply a vector by a scalar of 2

6 months ago

Solved

Find the product of a Vector

How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?; x = [1 : 0.5 : 6]; y ...

6 months ago

Solved

Elastic Collision 001: 1-D

Elastic Collision of two particles. <http://en.wikipedia.org/wiki/Elastic_collision wiki Elastic Collision> Solve Conservat...

6 months ago

Solved

Momentum Calculation

A shopping cart of mass 'm1' is traveling with velocity 'u' and collides with a second shopping cart of mass 'm2.' The two shopp...

6 months ago

Solved

Summing digits

Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

6 months ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

6 months ago

Solved

Find the numeric mean of the prime numbers in a matrix.

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

6 months ago

Solved

Who Has the Most Change?

You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

6 months ago

Solved

Sum of digits of powers of 2

Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example: Input: n = 7 2^n = ...

7 months ago

Solved

Do you like your boss?

Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

7 months ago

Solved

Sort vector by number of prime factors of each element

Sort a given array based on how many prime factors each term has. Sort from least to greatest and output original values. Ex: ...

7 months ago

Solved

User defined nextpow function

Create a function which will take 2 arguments as n and x, and return y, where, n^y >= abs(x). [ Similar to builtin "nextpow2" fu...

7 months ago

Solved

Number of vertices of a hypercube

Return the number of vertices of a n-dimensional hypercube.

7 months ago

Solved

Check if equal

Return true if all the elements of an nD array are equal, false otherwise.

7 months ago

Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

7 months ago

Solved

Penny flipping - calculate winning probability (easy)

Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

7 months ago

Solved

Back to Basics - Find no. of elements in a matrix?

Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

7 months ago

Solved

Back to basics 11 - Max Integer

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

7 months ago

Solved

Convert yards to feet

The goal of this script is to convert a value given in yards to feet.

7 months ago

Solved

metre to feet converter

The idea is to make a converter, which exchange meters to feets. We use a factor of 1m = 3.281*1f. so 3m are equals to 9.843 m...

7 months ago

Solved

How to calculate log?

There is a log that have base 5. How to calculate? log5(x)?

7 months ago