Solved


Easy Sequences 102: One-line Code Challenge - Take While Function
takeWhile is another useful functional programming construct. The takewhile function is similar to the built-in function arrayfu...

6 months ago

Solved


Compute the critical depth of a channel
Problem statement Write a function to compute the critical depth of a channel with discharge . The unit system will be specifie...

6 months ago

Solved


Compute the normal depth of a channel
For steady uniform flow in a channel of constant cross section and slope, the depth does not change with distance or time. In th...

6 months ago

Solved


Route a hydrograph through a river section with the Muskingum method
Problem statement Write a function that routes a hydrograph through a river section using the Muskingum method. The input to t...

6 months ago

Solved


Compute infiltration and runoff under constant precipitation with the Green-Ampt method
Problem statement Write a function that computes infiltration, depression storage, and runoff using the Green-Ampt method. It s...

6 months ago

Solved


Find the circle inscribed in a triangle
Write a function that takes the x- and y-coordinates of three points describing the vertices of a triangle and returns the cente...

6 months ago

Solved


Suma de Gauss
¿Cuál es la suma de los primeros enteros positivos?

6 months ago

Solved


Continuous NaNs - I
Remove any continuous NaNs that appear in the array - %Example 1 input = [1 NaN 2 NaN NaN 3 NaN NaN NaN] output = [1 NaN 2 ...

6 months ago

Solved


Calculate the Voltage Through a Step-Up Transformer
Given a step-up transformer has a primary coil with A number loops, a secondary coil with B number loops, and a primary voltage ...

6 months ago

Solved


Find the mean of the magic x
Given a x term, find the magic x, then find the mean/average of any one row or column.

6 months ago

Solved


factorial_calc(n)
Write a MATLAB function called factorial_calc(n) that takes a positive integer n as input and calculates the factorial of n. The...

6 months ago

Solved


Find circular arc length, sector area and segment area
Given a circular arc passing through the points P = [ x1 y1 ] and Q = [ x2 y2 ] such that the center angle of the arc (in degree...

6 months ago

Solved


Given a string s, find the length of the longest substring without repeating characters.
Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" O...

6 months ago

Solved


Determine the minimum number of swaps to sort a vector
Cody Problem 1401 asks us to sort a vector with the bubble sort algorithm and count the number of swaps needed. For example, to ...

6 months ago

Solved


Easy Sequences 104: One-line Code Challenge - GCDs of Sum of Consecutive Cubes
For a natural number, n, the function CC(n) is defined as follows: In other words, CC(n) is the sum of cubes ...

6 months ago

Solved


Easy Sequences 105: One-line Code Challenge - IPv4 Address Validation
The Internet Protocol version 4 (IPv4) is the dominant protocol for routing devices over the internet. IPv4 addresses are usuall...

6 months ago

Solved


Given the mass and stiffness of an undamped SDOF system, find the natural frequency and the natural period of vibration
Problem Statement Given the mass and stiffness of an undamped SDOF system, find the system's natural frequency in both Hz and...

6 months ago

Solved


Calculate BMI
Given weight in kgs and height in metres, calculate body mass index

6 months ago

Solved


Find gradient of a numeric data which has same size as the existing vector.
**** Refer matlab documentation about finding gradient **** Convert the entire gradient vector to least integer form. (Probably...

6 months ago

Solved


Solve an ODE: draining tank
Write a function to compute the time to drain a cylindrical tank of diameter from an initial level to a level . The outflow oc...

6 months ago

Solved


Armstrong Number
Write a function name armstrong_check that checks whether the given input is an Armstrong Number or not. It returns logical True...

6 months ago

Solved


Zero finder
Write a function named 'zero_finder' that takes a matrix as input and returns the row index of the last zero for each for each c...

6 months ago

Solved


Easy Sequences 97: One-line Code Challenge - Sequence with Constant Difference
While answering Problem #57725, I noticed a pattern that immediately led me to a solution, namely: the -th difference of the seq...

6 months ago

Solved


Inscribe a circle in a triangle with a side of length equal to the circle’s circumference
A circle of radius is inscribed in a triangle with a side that has a length equal to the circle’s circumference. The center of ...

6 months ago

Solved


Number of images formed due to two inclined mirrors and their coordinates
There are two mirrors with angle theta between them and there is an object on x axis. Determine the number of images formed and ...

6 months ago

Solved


Determine whether a hydrograph is a unit hydrograph
A hydrograph describes the runoff response of a catchment or watershed to rainfall. It shows the runoff rate (or flow or discha...

6 months ago

Solved


Easy Sequences 101: One-line Code Challenge - n-th Digit of Fibonacci Sequence
For a given index , the -th Fibonacci number, is defined as: for or , and for . What this problem requires is find the dig...

6 months ago

Solved


Radius of an inner N-dimensional sphere
A hypercube is an N-dimensional analogue of a square (N=2). Similarly, an N-sphere is an N-dimensional analogue of a circle. Not...

6 months ago

Solved


Easy Sequences 100: One-line Code Challenge - 100th Digit of 100th power of an Integer
Given a integer , write a function that computes the digit of . If has less than digits just output a NaN. For example if , ...

6 months ago

Load more