Solved


Two dimensional moving average
A=[1 2 3 4 5 1 2 2 2 3 2 3 3 3 4 1 1 4 4 2] B=[1 1;1 1]; % This is can be used for weight factor of moving a...

8 years ago

Solved


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

8 years ago

Solved


Find longest run
Write a function longest_run that takes as input an array of 0's and 1's and outputs the length and index of the longest consecu...

8 years ago

Solved


Count given word x in text.
Count how many times given word x repeats in text.

8 years ago

Solved


Move if I am Optimus Prime
If the number is a prime, roll out!

8 years ago

Solved


Delete the column with all 0 !
Delete the column with all 0 data in a matrix(x). e.g. input x = 1 0 0 4 5 0 7 0 ...

8 years ago

Solved


i forgot to use capital I
When referring to yourself you should write "I" (capital) and not "i". So correct the input string x, but be aware that other u...

8 years ago

Solved


Counting the Grand Primes
A grand prime pair is a pair of primes, p1 and p2=p1+1000, such that both numbers are prime. Like a twin prime pair, where the d...

8 years ago

Solved


Return the names and values of the input arguments of a function
Given a function name, return the names and values of the input arguments. e.g. function_name(arg1, arg2) is a function de...

8 years ago

Solved


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

8 years ago

Solved


Convert decimal to hex as shown in test cases
Convert decimal to hex as shown in test cases.

8 years ago

Solved


Funny problems
Generate the following vector: if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

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

8 years ago

Solved


square root
Find square root of given number

8 years ago

Solved


Simple String Concatenation
This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating t...

8 years ago

Solved


Find the index of the lowest number in a matrix
Take a matrix, and find the [row cal] index of the lowest number

8 years ago

Solved


How many bottles can you drink?
Sometimes if you buy a drink in a glass bottle you can return that bottle and get some money back. Let's assume we have "x" a...

8 years ago

Solved


Multiply Column
Given two input, one matrix and one scalar number For example A is a matrix given A = [ 1 2 2 5 2 5 2 3 4 6...

8 years ago

Solved


subtraction of two nos
given a and b, subtract and give the answer

8 years ago

Solved


Fermat's last theorem - again
For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique...

8 years ago

Solved


Put m balls into n boxes (again)
According to <http://www.mathworks.com/matlabcentral/cody/problems/1516-put-m-balls-into-n-boxes Cody Problem 1516>, if I put 3 ...

8 years ago

Solved


Put m balls into n boxes
Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1...

8 years ago

Solved


Clamper Function
Create a function that emulates a clamper circuit Given sin wave, t and the constant value for clamping

8 years ago

Solved


Calculate sin(x) without sin(x)
Calculate y = sin(x) x = 0 -> y= 0 without the use of sin(x) or cos(x)

8 years ago

Solved


Rotate Matrix Both Direction (45 Degree)
*Matrix (3x3 only) rotation*: 3 inputs: *x* matrix, *n* times and *m* option. output: *y* matrix with *n x 45* degree ...

8 years ago

Solved


Finger Counting
Just counting numbers using fingers. First all my ten fingers are closed. I will say 1 and open my one finger. Likewise for 6...

8 years ago

Solved


Repeat string n times
* You will be provided a string (s = 'string1_') * a starting point (num1 = 6) (always bigger than or equal to zero) * and n (...

8 years ago

Solved


Mean ignoring NaNs
Define a function that behaves in the same way as mean(x) and mean(x,d) except that it ignores NaNs (unless all of the values be...

8 years ago

Solved


Given a number N, find the smallest prime P>N
Given a number N, find the smallest prime P greater than N. For example: If N=10 then P=11. If N=13 then P=17.

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

8 years ago

Load more