Solved


remove every row&col for every nan
for a given matrix, remove the row and column of every nan. Example x=[1 2 NaN 4 5 6 7 8 ...

8 years ago

Solved


Determine whether the input is odd, even, or neither.
Make a function that returns ‘odd’ if the input is odd, ‘even’ if the input if even or ‘error’ if the input is neither odd nor ...

8 years ago

Solved


lb to kilogram
convert lb to kilogram units, easy

8 years ago

Solved


Simulate one complete step in the Biham–Middleton–Levine traffic model
The <http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model Biham–Middleton–Levine traffic model> is ...

8 years ago

Solved


Data Regularization
Provided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set *S* = [1,2,3,...,S] for any large in...

8 years ago

Solved


How many complete pizzas
x is a vector with numbers of pizza slices. A corresponding vector n indicates in how many slices the pizza slices of x were cut...

8 years ago

Solved


Moving Product (Easy)
Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* ...

8 years ago

Solved


Wheat on a chessboard pt 2
If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successiv...

8 years ago

Solved


Twist 'n' Match
Given n and m, construct an n-by-n matrix a such that a, when rotated 90 degrees and compared with itself, matches itself in exa...

8 years ago

Solved


Matrix spiral
Make a spiral in a (n*n) matrix. The spiral has to start in the top left, and has to rotate clockwise to the center. The spiral ...

8 years ago

Solved


Give me Hamming on five, hold the mayo
A Hamming Number is a positive number that has no prime factor greater than 5. Given a number X, determine how many Hamming num...

8 years ago

Solved


Shuffle
Shuffle a vector by breaking it up to segments of |n| elements, and rearranging them in a reversed order. For example, the ve...

8 years ago

Solved


Construct a "diagAdiag" matrix
Construct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below: For: n = 4 ...

8 years ago

Solved


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

8 years ago

Solved


Cumulative maximum of an array
Find the cumulative maximum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummax.htm...

8 years ago

Solved


Cumulative minimum of an array
Find the cumulative minimum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummin.htm...

8 years ago

Solved


Index one element in each vector of an array along a given dimension
Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

8 years ago

Solved


Vandermonde Matrix
Create the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column i...

8 years ago

Solved


Decoder Ring
You are given a matrix of numbers, your objective is to use the decoder ring to find the hidden message. ex. encoded_messa...

8 years ago

Solved


The answer to life the universe and everything
Write a function that gives the answer to life the universe and everything to every input except the input is 42. In this case t...

8 years ago

Solved


Calculate trends in time series
Create a new variable that has trends in input series. If _t+1_ is bigger than or equal to _t_, than trend in _t_ will be 1, oth...

8 years ago

Solved


Let's make puddings !
We will make puddings with eggs, milk and sugar. To make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar. Now W...

8 years ago

Solved


Automatic String Editing
In this function, you will take an incoming string, and output the same string with each character one letter later in the alpha...

8 years ago

Solved


Leading-zero padding
Write a function that will add leading-zero padding to all numbers in the supplied vector, as necessary, based on the maximum nu...

8 years ago

Solved


Find the starting index of a consecutive condition
Given a logical vector |v|, and a positive integer |n|, return the smallest index |i| that satisfies: all( v(i : i+n-1) ) =...

8 years ago

Solved


Moving Median Absolute Deviation
The median absolute deviation (MAD) is defined as MAD = median(abs(A − median(A))) for a rolling window of length n. For...

8 years ago

Solved


Regular polygon bounded by and bounding a circle
As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area ...

8 years ago

Solved


Make a rainbow matrix (follow-up to checkerboard matrix)
Given an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number ...

8 years ago

Solved


Distance between two GPS Coordinates
A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

8 years ago

Solved


Compute circular convolution
In signal processing, we usually encounter the circular convolution case. Compute it here using the two input sequences (denoted...

8 years ago

Load more