Gelöst


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

mehr als 10 Jahre vor

Gelöst


Frobenius Norm
Write your own version of Frobenius Norm without using the 'norm' function.

fast 11 Jahre vor

Gelöst


Simple problem creating a function from an abstract specification.
MYSTERYFUNCTION3 This takes a vector of numbers v and computes a vector w such the w[i] is the average of v[i] and the previous...

fast 11 Jahre vor

Gelöst


The rabbit problem
Someone discovered that rabbits reproduce at the rate of fibonnaci so you just input the number and it will print the fibonnaci ...

fast 11 Jahre vor

Gelöst


Sum the numbers on the main diagonal
Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

fast 11 Jahre vor

Gelöst


Spiral Matrix
for a given integer n>=3, generate a matrix of nxn such that the value n^2 is at bottom left and its decreasing towards center ...

etwa 11 Jahre vor

Gelöst


Implement a bubble sort technique and output the number of swaps required
A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

etwa 11 Jahre vor

Gelöst


select the primes of a vector
Find the prime numbers in a vector

etwa 11 Jahre vor

Gelöst


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

etwa 11 Jahre vor

Gelöst


Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

etwa 11 Jahre vor

Gelöst


Moving average (variable kernel length)
Find the moving average in a vector. The kernel length is a variable. For example x = 1:10 kernel_length = 2 would r...

etwa 11 Jahre vor

Gelöst


MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string. For example A='harsa'; b='harish'; result '1' ...

etwa 11 Jahre vor

Gelöst


Special matrix
Make a square matrix with this shape. For n=4 M = 1 1 0 0 1 0 1 0 0 1 0 ...

etwa 11 Jahre vor

Gelöst


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

etwa 11 Jahre vor

Gelöst


Binary Coder
Take an input number and print the binary value of this number.

etwa 11 Jahre vor

Gelöst


Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...

etwa 11 Jahre vor

Gelöst


Two-output anonymous function?
Return a function handle that when applied to an input, it produces two outputs: the first is the same as the input, and the sec...

mehr als 11 Jahre vor

Gelöst


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

mehr als 11 Jahre vor

Gelöst


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

mehr als 11 Jahre vor

Gelöst


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

mehr als 11 Jahre vor

Gelöst


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

mehr als 11 Jahre vor

Gelöst


Polybius Square
Given a string, calculate the coordinates. Input will be always in lowercase. If string is a sentence then use 0 (zero) to indic...

mehr als 11 Jahre vor

Gelöst


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

mehr als 11 Jahre vor

Gelöst


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

mehr als 11 Jahre vor

Gelöst


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

mehr als 11 Jahre vor

Problem


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

mehr als 11 Jahre vor | 10 | 264 Lösungsvorschläge

Gelöst


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

mehr als 11 Jahre vor

Gelöst


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

mehr als 11 Jahre vor

Gelöst


Maximum running product for a string of numbers
Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

mehr als 11 Jahre vor

Gelöst


Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

mehr als 11 Jahre vor

Mehr laden