Solved


Matrix indexing with two vectors of indices (★★)
(copy of Prob 589) Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if...

2 months ago

Solved


Extract leading non-zero digit (★★★★★)
(Copy of Problem 47) Benford's Law states that the distribution of leading digits is not random. This is probably because man...

2 months ago

Solved


How to locate the position of an element in a vector without using the find function
(copy of prob 105 with test for find function) Write a function posX = *locatePos* (x,y) which returns the location o...

2 months ago

Solved


Reindex a vector (★★)
(copy of Prob. 676) You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX h...

2 months ago

Solved


Mo money, mo math #2! (★★★)
(adapted from Prob 9 Cody team) You have a matrix for which each row is a person and the columns represent the number of quar...

2 months ago

Solved


Basic Algebra II
You have the equation X^2 = n you should find the value of X. GOOD LUCK!

2 months ago

Solved


Fuel-Air Equivalence Ratio (Lambda)
Lambda (λ) is the ratio of actual air-fuel ratio to the stoichiometric air-fuel ratio. λ = 1 is perfect stoichiometry, λ < 1...

2 months ago

Solved


Specific Fuel Consumption
Brake-specific fuel consumption (BSFC) measures how efficiently an engine converts fuel mass into useful work. Modern petrol e...

2 months ago

Solved


Mo money, mo math 1! (★★★)
(adapted from Prob 9 Cody team) You have a vector where the elements represent the number of $20 bills, $10 bills, $5 bills, ...

2 months ago

Solved


Generalizing square area to triangle area
Cody Problem 61070 asked for the height, h, of a right triangle that had the same area, A, of a square with side length, c, and ...

4 months ago

Solved


Block average ignoring NaN values
Given a matrix, calculate the block average of each disjoint sub-matrix while ignoring *NaN* values. Assume that the size of the...

4 months ago

Solved


Block average
Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix alo...

4 months ago

Solved


Neural Net: Back Propagation of Quad Output with Bias, ReLU
This challenge is to return the WH_delta and WP_delta, given X, WH, WP, EPY using ReLU on the hidden layer and Softmax on the ou...

5 months ago

Solved


sparse_matrix
You convert a vector to a sparse matrix. for example *x* =[1 2 3]; output will be *y* = [1 0 0 ...

5 months ago

Solved


Compute Airspeed from Mach Number
Write a MATLAB function that converts a Mach number to airspeed given the speed of sound aa in m/s: V=M⋅a V = airspeed (m/s) M...

5 months ago

Solved


make histogram
You probably know the function hist(x,n) to get the histogram. Now try to write the function yourself! For the cheaters wanting...

5 months ago

Solved


Weighted moving average
x1=[1 2 1]; y1=[1 2 2 4 5 6 6 8]; Make function for weighted moving average. z(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1...

5 months ago

Solved


Return longest string in 1-D array of strings
Find the longest string in an array of strings. Return an empty string if the initial array is empty. If there are multiple stri...

5 months ago

Solved


Find smallest integer type to accommodate your number
MATLAB supports 1-, 2-, 4-, and 8-byte storage for integer data. Find the smallest integer type to accomodate a scalar integer. ...

5 months ago

Solved


Initialize a varible with an integer value from a another variable which is assigned with a character value.
Initialize a varible with an integer value from a another variable which is assigned with a character value. ex: Test = 'c'...

5 months ago

Solved


Find the position of planet in solarsystem
Write a funtion named *nthplanet* which takes name of the planet as input string and provides the position of the planet, starti...

5 months ago

Solved


Two functions (to be sure)
I want to compute the number of odd/even numbers in an array. But I want the results by two different functions. Example: ...

5 months ago

Solved


Number Puzzle - 051

5 months ago

Solved


Rumis Scorer 2
<http://en.wikipedia.org/wiki/Rumis Rumis> is a multiplayer 3D block board game where the goal is to have the most squares visib...

5 months ago

Solved


UICBioE240 problem 1.7
Find the other two angles of a right triangle given the two of the sides. So if A = [1 1] B = [45 45]

5 months ago

Solved


Unique - Very Very Large Numbers
Given a vector column, with some very large numbers, create the ascending sort and unique vector. *Input:* A (column vector)...

5 months ago

Solved


Compute average gain for some bets.
Given a vector containg the odds of some events in decimal format (e.g., |odds=[1.3 2.5 1.5]| ) and a vector of the same dimensi...

5 months ago

Solved


Write a code to implement Euler's method to integrate a simple function
Euler's method approximates the solution to a differential equation as where . The challenge is to write a code that can take...

5 months ago

Solved


Determine if a number is a cool number
A number is considered cool if it is 3 digits, has a 5 in it, and is divisible by 4.

5 months ago

Load more