Solved


Block average
Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix alo...

nästan 6 år ago

Solved


Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

nästan 6 år ago

Solved


Check if there are white spaces in the input string
If there are white spaces in the input string, output=1 else 0

nästan 6 år ago

Solved


Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

nästan 6 år 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: ...

nästan 6 år ago

Solved


Use of regexp
Given a string, containing several sentences, such as: 'I played piano. John played football. Anita went home. Are you safe?...

nästan 6 år ago

Solved


newRMS
find root mean square of a signal x in less time than the test code and accurate to six places.

nästan 6 år ago

Solved


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

nästan 6 år ago

Solved


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

nästan 6 år 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 - ...

nästan 6 år ago

Solved


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

nästan 6 år ago

Solved


Fill the matrix - 1
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the s...

nästan 6 år 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...

nästan 6 år ago

Solved


Cookie Cutters
Given a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the large...

nästan 6 år ago

Solved


Minimum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/min.html min> function can operate along either the rows or the columns...

nästan 6 år ago

Solved


Maximum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/max.html max> function can operate along either the rows or the columns...

nästan 6 år ago

Solved


Find the average of a random sequance
Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

nästan 6 år ago

Solved


Find maximum value of a curve
Two vectors shall be already defined: - Input vector x (e.g. x = 0:1:10) - Result vector y (e.g. y = sin(x)) Create a n...

nästan 6 år ago

Solved


Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

nästan 6 år ago

Solved


Replace all zeros and NaNs in a matrix with the string 'error'
Given a numeric input matrix A, possibly containing some zero values and some NaNs, replace any occurrences of zero or NaN with ...

nästan 6 år ago

Solved


Basic matrix operations using standard MATLAB commands
Create the matrix: 1.0e+15 * 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000...

nästan 6 år ago

Solved


Repetition of matrices
*A is a bold matrix: [1 2 3; 4 5 6;7 8 9]* Given an integer 'n' , a matrix B exists such that has n copies of A in the row an...

nästan 6 år ago

Solved


Sum of diagonals
Compute the sum of diagonal elements of a square matrix and store the larger sum to s. Eg : a = [1 2 3; 2 3 4; 4 5 10] ...

nästan 6 år ago

Solved


'Absolute value'
Create a function called own_abs, which is the absolute number entered as the input return value.

nästan 6 år ago

Solved


Calculate mean value of any pair in a vector.
Given a vector A, calculate the mean of 2 number in the vector one by one. example: input: A=[1, 5, 6, 8, 9, 15] output:...

nästan 6 år ago

Solved


Prime numbers between a , b.
Find all prime number between a & b (including a and b). example: a=100 b=120 y= [101 103 107 109 113]

nästan 6 år ago

Solved


Remove white spaces at the end of the input string
Remove all trailing white spaces at the end of the input strings

nästan 6 år ago

Solved


Transpose the Matrix
Transpose the given matrix, e.g. x=[a b;c d] transpose of x = [a c;b d]

nästan 6 år ago

Solved


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

nästan 6 år ago

Solved


Specific toolboxes
Given a string that is the name of a MATLAB toolbox, return true if it is available on the Cody solvers evaluation system, false...

nästan 6 år ago

Load more