Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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.

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Resuelto


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

2 meses hace

Cargar más