PhD student in Mechanical Engineering, with an interest in robotics

Solved

Extra safe primes

Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

2 years ago

Solved

Sums of Distinct Powers

You will be given three numbers: base, nstart, and nend. Write a MATLAB script that will compute the sum of a sequence of both ...

2 years ago

Solved

5th Time's a Charm

Write a function that will return the input value. However, your function must fail the first four times, only functioning prope...

2 years ago

Solved

"Cody" * 5 == "CodyCodyCodyCodyCody"

*Alice*: What? *"Cody" * 5 == "CodyCodyCodyCodyCody"*? You've gotta be kidding me! *Bob*: No, I am serious! Python supports...

2 years ago

Solved

Pernicious Anniversary Problem

Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

2 years ago

Solved

Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.

Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

2 years ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

2 years ago

Solved

How to subtract?

*± ± ± ± ± ± ± ± ± ± ±* * Imagine you need to subtract one...

2 years ago

Solved

The 5th Root

Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

2 years ago

Solved

Energy of a photon

Given the frequency F of a photon in giga hertz. Find energy E of this photon in giga electron volts. Assume h, Planck's ...

2 years ago

Answered

How to remove 0 (for 'double' numerical type) or [] (for cell type) rows in a table ?

Starting point: tab = S_Bankname S_CommonEquityTierRatio_2013 S_Log_TotalAssets_2013 __________ ...

How to remove 0 (for 'double' numerical type) or [] (for cell type) rows in a table ?

Starting point: tab = S_Bankname S_CommonEquityTierRatio_2013 S_Log_TotalAssets_2013 __________ ...

3 years ago | 0

Solved

Remove NaN ?

input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

3 years ago

Solved

Character variable: Compass direction

* Assign compassDirection with sensorReading's value. Both are character variables.

3 years ago

Solved

Arithmetic array operations

* Add x to each element of array temperatureReadings.

3 years ago

Solved

Back to basics 10 - Max Float

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

3 years ago

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

3 years ago

Solved

Back to basics 1 - Saving

Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

3 years ago

Solved

Function definition: Double down.

* Complete the DoubleDown function to return twice the initialValue.

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

3 years 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,...

3 years ago

Solved

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

3 years ago

Solved

Compute a dot product of two vectors x and y

x and y are input vectors, d is a number and contains their dot product

3 years ago

Solved

Determine Whether an array is empty

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

3 years ago

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

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

3 years ago

Solved

Project Euler: Problem 10, Sum of Primes

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

3 years ago

Solved

Interpolator

You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

3 years ago

Solved

Construct an array

* Construct an row array named observedValues with elements sensorReading1, sensorReading2, and sensorReading3.

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

3 years ago