Solved


Min of a Matrix
Return the minimum value in the given matrix.

7 years ago

Solved


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

7 years ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

7 years ago

Solved


Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

7 years ago

Solved


Return area of square
Side of square=input=a Area=output=b

7 years ago

Solved


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

7 years ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

7 years ago

Solved


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

7 years ago

Solved


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

7 years ago

Solved


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

10 years ago

Solved


Angle between Two Vectors
The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

10 years ago

Solved


Number of odd and even elements within matrix
Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

10 years ago

Solved


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

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


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

10 years ago

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

10 years ago

Solved


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

10 years ago

Solved


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

10 years ago

Solved


Add two numbers
Add two numbers (For beginners)

10 years ago

Solved


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

10 years ago

Solved


Find same numbers touching each other...
So the goal here is to find any number that is equal to its immediate neighbors and mark it true. Here is some examples: x...

10 years ago

Solved


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

10 years ago

Solved


Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

10 years ago

Solved


Create incrementing array
Given a and b generate an output matrix as shown in following examples: a=2 b=5 output=[2 20 200 2000 20000] a=4 b...

10 years ago

Solved


Mirror Image matrix across anti-diagonal
Given an input number x, create a Mirror Image matrix 'Y' across anti-diagonal in following way:- Example:- If x=3, Y= [1 ...

10 years ago

Solved


Calculate the nth Fibonacci number USING 'Golden Ratio' concept
f = [1 1 2 3 5 8 13 ...] If n=6, f(6)=8

10 years ago

Solved


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

10 years ago

Solved


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

10 years ago

Solved


find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

10 years ago

Solved


Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.

10 years ago

Load more