A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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.

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

Charger plus