Solved

Add two numbers

Calculate the sum of two numbers. Example input = [2 3] output = 5

oltre 3 anni ago

Solved

Duplicates

Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

oltre 3 anni ago

Solved

Rotate a Matrix

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

oltre 3 anni ago

Solved

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

oltre 3 anni ago

Solved

Arithmetic array operations

* Add x to each element of array temperatureReadings.

oltre 3 anni ago

Solved

Rotate a Matrix by 90 degrees

Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

oltre 3 anni ago

Solved

Fahrenheit to Celsius using multiple statements

°C = (°F - 32) x 5/9 * Write a statement that assigns fractionalMultiplier with 5/9. * Write a second statement that assign...

oltre 3 anni ago

Solved

Integer indexing array: Weekend box office

The row array movieBoxOffice stores the amount of money a movie makes (in millions of $) for the 7 days of a week, starting with...

oltre 3 anni ago

Solved

Write an expression

Assigns finalResult with firstSample plus secondSample, squared, then divided by 3. Ex: If firstSample is 18 and secondSample is...

oltre 3 anni ago

Solved

Plus x: A first program

_Solve this problem in Mathwork's online Cody system._ Write a statement that assigns y with 5 plus x. Ex: If input x = 2,...

oltre 3 anni ago

Solved

Simple equation: Annual salary

Given an hourly wage, compute an annual salary by multiplying the hourly wage times 40 and times 50, because annualSalary = hour...

oltre 3 anni ago

Solved

Connect blocks in a model

Connect the blocks in the model to produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/connect-blocks...

oltre 3 anni ago

Solved

Circle area using pi

Write a statement that assigns circleArea with the circle's area given circleRadius. Use the built-in mathematical constant pi. ...

oltre 3 anni ago

Solved

QWERTY coordinates

Given a lowercase letter or a digit as input, return the row where that letter appears on a <http://en.wikipedia.org/wiki/Keyboa...

oltre 3 anni ago

Solved

Counting Money

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

oltre 3 anni ago

Solved

Which doors are open?

There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

oltre 3 anni 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/...

oltre 5 anni ago

Solved

How many trades represent all the profit?

Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

oltre 5 anni ago

Solved

Hard limit function

Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

oltre 5 anni ago

Solved

Speed of light:Experiment

in 1849, Fizeau set up an experiment to measure the speed of light. The discription of this experiment can be found on wikipedi...

oltre 5 anni ago

Solved

Generalized Fibonacci

The Fibonacci sequence is defined as: Fib(1) = 0 Fib(2) = 1 Fib(N) = Fib(N-1) + Fib(N-2) The Fibonacci sequence ca...

oltre 5 anni ago

Problem

Generalized Fibonacci

The Fibonacci sequence is defined as: Fib(1) = 0 Fib(2) = 1 Fib(N) = Fib(N-1) + Fib(N-2) The Fibonacci sequence ca...

oltre 5 anni ago | 3

Solved

Back to basics 21 - Matrix replicating

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

oltre 5 anni ago

Solved

Filter AC, pass DC

Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

oltre 5 anni ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

oltre 5 anni ago

Solved

Make a Palindrome Number

Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

oltre 5 anni ago

Solved

Determine Whether an array is empty

Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

oltre 5 anni ago

Solved

Stuff the Board

You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

oltre 5 anni ago

Solved

Scoring for oriented dominoes

Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

oltre 5 anni ago