Solved

Arrange vector in ascending order

Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

3 years ago

Solved

Make a run-length companion vector

Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

3 years ago

Solved

Model a falling body

An object is falling freely from a height of 22 meters under the force of gravity. <<http://blogs.mathworks.com/images/seth/c...

3 years ago

Solved

Add damping to a mass spring system

Model an ideal mass-spring-damper system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/im...

3 years ago

Solved

Counting pulses in a signal

Count the number of pulses that are the result of summing each pulse generator block. Pulse Generator blocks produce a recurr...

3 years ago

Solved

Make a half wave rectifier

Produce a signal that outputs the given sine wave source when it is greater than zero and outputs zero when it is less than zero...

3 years ago

Solved

Make a full wave rectifier

Produce a full wave rectifier waveform for the given sine wave source. For a sine wave input, the output of the full wave rec...

3 years ago

Solved

Add offset to a signal

Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-offset-eqn.png>> You should see a downward...

3 years ago

Solved

Produce a sine wave

Produce a sine wave with amplitude 3: <<http://blogs.mathworks.com/images/seth/cody/sine-eqn.png>>

3 years ago

Solved

Implement simple rotation cypher

If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

3 years ago

Solved

Back to basics 22 - Rotate a matrix

Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

3 years ago

Solved

QWERTY Shift Encoder

Encode a string using the QWERTY shift code. This code is where you touch type but are offset by one character to the right. ...

3 years ago

Solved

Decimal Comparison

*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

3 years ago

Solved

Subset Sum

Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

3 years ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

3 years ago

Solved

Generate binary combinations for a given number of bit(s)

Generate the binary combination as in the example below. Example: If you are given: bin_comb(2) The answer will be: ...

3 years ago

Solved

Find matching string from a list of strings

Write a function that returns a string that is a unique match (if it exists) of the string |inStr| from a list of strings |strLi...

3 years ago

Solved

Cumulative probability of finding an unlikely combination

This is a supplemental problem to the <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition CryptoMath> ...

3 years ago

Solved

Find mistyped words in text (mixed-up letters)

Mistyped words are a regular occurrence in emails, texts, status updates, and the like. Many times, people send or post a second...

3 years ago

Solved

Who knows the last digit of pi?

There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

3 years ago

Solved

First use of arrayfun() and anonymous function @(x)

Create an anonymous function using @(x) for a parabola equation for the given coefficients stored in s with s(1)x2 + s(2)x +...

3 years ago

Solved

Without the French accent please!

Suppress the French accent. Example 'Déjà présent' -> 'Deja present'

3 years ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

3 years ago

Solved

When Was That Goal Scored?

We want to find out when the goals were scored in a particular soccer game. For each game, we are given a "Goal Event Data" XML ...

3 years ago

Solved

Compute Fibonacci Number

Compute the _n_-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

3 years ago

Solved

QWERTY Shift Code Decoder

Decode a string encoded using the QWERTY shift code. QWERTY shift code is where the message was touch typed but with an offse...

3 years ago

Answered

weird artefacts when saving piechart as pdf

Someone had the same issue on <https://stackoverflow.com/a/45497856/2254698 stack overflow> I found adding any one of these, ...

weird artefacts when saving piechart as pdf

Someone had the same issue on <https://stackoverflow.com/a/45497856/2254698 stack overflow> I found adding any one of these, ...

3 years ago | 0

Problem

Assert yourself! Hack the assert function to pass this test.

Have you ever wanted to test out one of the hacks you have seen where "games" a problem by simply overwriting the assert method?...

3 years ago | 1 | 9 solvers

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

3 years ago

Solved

Maximum running product for a string of numbers

Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

3 years ago