Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

10 years ago

Solved


Non-zero bits in 10^n.
Given an integer that is a power of 10, find the number of non-zero bits, k, in its binary representation. For example: * ...

10 years ago

Solved


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

10 years ago

Solved


Three grind is shipsstraigt
A function that returns either 'Rock', 'Scissors', or 'Paper' (string). You may succeed or you may fail the (case insensitive) t...

10 years ago

Solved


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

10 years ago

Solved


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

10 years ago

Solved


Make an N-dimensional Multiplication Table
*INSTRUCTIONS* This is a multi-dimensional variant of the normal multiplication table used to teach elementary students multi...

10 years ago

Solved


Polygonal numbers
The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

10 years ago

Solved


Remove all the columns contains only zero
Remove the column from the matrix which has only zeros . Refer the Example below a= 1 0 3 0 23 0 56 0 1 ...

10 years ago

Solved


ESEMPIO
controllo uso funzioni

10 years ago

Solved


Create vector as shown in test cases
Create vector as shown in test cases

10 years ago

Solved


Solve cosine without cos(x)
Solve cos(x). The use of the function cos() and sin() is not allowed.

10 years ago

Solved


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

10 years ago

Solved


2D Indexes
Given in input the maximum degree P, the algorithm furnishes a ordered list of two dimensional vectors [i,j] i,j>=0 such that i+...

10 years ago

Solved


Calculate the hypotenuse of a right triangle without using ^ and sqrt ()
Find out the hypotenuse of right triangle. Say a = 4, b = 3 then c = 5 Please don't use ^ and sqrt() function.

10 years ago

Solved


Finding two missing number in 1 to n array
You are given an array of numbers from 1 to n with two missing numbers. Return the two missing numbers. Input: x=[5 2 0 1 ...

10 years ago

Solved


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

10 years ago

Solved


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

10 years ago

Solved


3D indexes
Generalisation in 3 dimensions of the <http://nl.mathworks.com/matlabcentral/cody/problems/43117-2d-indexes Problem 43117. 2D I...

10 years ago

Solved


Marvel or DC?
Given input vector determine if there's a DC value. If there is, output 'DC', else output 'MARVEL'

10 years ago

Solved


I told you not separate me, but you did :( - ACDC
Given input vector, output it's DC and AC value Example: input = 0 1 -1 0 ac = 0 1 -1 0 dc = 0

10 years ago

Solved


Linear Least Squares (L2 fitting problem )
Given a set of real measurements (x(i), y(i)) find a line sol(1)x + sol(2) (more specifically furnish the vector with...

10 years ago

Solved


A little bit of luck needed
This one may require a little bit of guess work, but it is possible. Hints: - The same solution might fail the tests once and ...

10 years ago

Submitted


Fast Sampling From A Discrete Distribution
This function generates independent random samples according to a prescribed discrete distribution.

10 years ago | 2 downloads |

5.0 / 5

Solved


Modified run-length companion vector
Given a vector x, return a vector that indicates the run length of any value in x. Each element in output vector shows how many ...

10 years ago

Solved


Weighted Convolution
Given two input vectors x = [x_1, x_2, ..., x_K] and y = [y_1, y_2, ..., y_K] of equal length, compute the weighted convolution ...

10 years ago

Problem


Weighted Convolution
Given two input vectors x = [x_1, x_2, ..., x_K] and y = [y_1, y_2, ..., y_K] of equal length, compute the weighted convolution ...

10 years ago | 6 | 43 solvers

Solved


Prouhet–Tarry–Escott (basic)
Inspired by <http://www.mathworks.com/matlabcentral/cody/problems/660-find-a-subset-that-divides-the-vector-into-equal-halves pr...

10 years ago

Solved


Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

10 years ago

Solved


Find the coefficients for numerical integration using Simpson's rule
For using numerical integration using Simpson's rule, we need some coefficients to be determined first. Suppose the n is the nu...

10 years ago

Load more