PhD student in Engineering.

Solved

Make a 1 hot vector

Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

25 days ago

Solved

Sum the 'edge' values of a matrix

Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

25 days ago

Solved

Compare two input matrices

Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

25 days ago

Solved

Back to basics 23 - Triangular matrix

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

25 days ago

Solved

Pi Estimate 2

Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation2.pdf>

26 days ago

Solved

Energy of an object

Calculate the total mechanical energy of an object. Total Energy= Potential energy + Kinetic energy P.E.=m*g*h K.E.=1/2...

27 days 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

1 month ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

1 month ago