Solved


String Logic 2
Example: ROSY --> HEIO TRUST --> JHKIJ MOSTLY --> CEIJBO

mer än ett år ago

Solved


String Logic 1
Examples: 'CAT' --> 'IGZ' 'DOG' --> 'JUM'

mer än ett år ago

Solved


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

mer än ett år ago

Solved


Random Problem14 - Multiply a vector by a scalar of 2
Multiply a vector by a scalar of 2

mer än ett år ago

Solved


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

mer än ett år ago

Solved


Find the minimum element of the matrix
Example: If x = [3 9; 5 2] then y = 2

mer än ett år ago

Solved


find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

mer än ett år 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 ...

mer än ett år ago

Solved


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

mer än ett år 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...

mer än ett år 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 + ...

mer än ett år 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 ...

mer än ett år ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

mer än ett år 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...

mer än ett år 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...

mer än ett år ago

Solved


Sort in descending order.

mer än ett år 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 = ...

nästan 2 år 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 ...

nästan 2 år 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: ...

nästan 2 år 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...

nästan 2 år ago

Solved


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

nästan 2 år ago

Solved


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

nästan 2 år 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...

nästan 2 år 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/...

nästan 2 år 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

nästan 2 år 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.

nästan 2 år ago

Solved


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

nästan 2 år 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...

nästan 2 år ago

Solved


Find remainder when x is divided by 3
Find remainder when x is divided by 3

nästan 2 år ago

Solved


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

nästan 2 år ago

Load more