Gelöst


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

mehr als 9 Jahre vor

Gelöst


Reverse digits of a number
Reverse digits of a number. For example, return *321* for the input *123* . The left-hand zeros can be discarded. For exam...

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


Rotate array 90 degrees
Rotate the given matrix by 90 degrees. Example, A = [1 2 3 ; 4 5 6 ] B = rotated(A) = [ 3 6; 2 5; 1 4 ]

mehr als 9 Jahre vor

Gelöst


Generate vector according to sign of vector
Generate vector according to sign of vector Example: If A=[-2 0 5] then output must be[-1 0 1] meaning that for negative n...

mehr als 9 Jahre vor

Gelöst


Sort the vector with the given index
Given x = [1 2 4 8 17] and t = [1 3 2 5 4] then y = [1 4 2 17 8].

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row

mehr als 9 Jahre vor

Gelöst


Find out value of sine given by degree.
Find out value of sine given by degree. If theta=30, it's value must be 0.5.

mehr als 9 Jahre vor

Gelöst


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

mehr als 9 Jahre vor

Gelöst


Don't Try, give up and return NaN.
This is another version of <http://www.mathworks.com/matlabcentral/cody/problems/3107-try-and-catch-simple-example problem 3107....

mehr als 9 Jahre vor

Gelöst


union without repitition
Let a = [9 9 9 9 9 9 8 8 8 8 7 7 7 6 6 6 5 5 4 2 1] b = [1 1 1 3 3 3 3 3 4 4 4 4 4 10 10 10] Output should be [9 8...

mehr als 9 Jahre vor

Gelöst


Determine the Anti-diagonal of a Magic Square
Determine the anti-diagonal (crossing from top right to lower left) of a magic square of size n. Examples If n = 3 y =...

mehr als 9 Jahre vor

Gelöst


Try and Catch Simple Example
Try and Catch Simple Example <http://in.mathworks.com/help/matlab/ref/try.html Example> Vector x=[1 4 6 8 10]; Create...

mehr als 9 Jahre vor

Gelöst


Add two hex numbers
Add two hex numbers

mehr als 9 Jahre vor

Gelöst


Find difference of two set as per example
Find difference of two set as per example Say x=[1:5] and y=[2:6] then, set_diff(x,y) should give output[1] and set_diff(y...

mehr als 9 Jahre vor

Gelöst


Decide whether determinant is zero.
Given a 3 x 3 matrix, find the determinant. Let y = true if the determinant is zero, and let y = false if the determinant is no...

mehr als 9 Jahre vor

Gelöst


Change the first and last diagonal element of the identity matrix to zero
Starting with the identity matrix, change first and last diagonal element to zero. Example If n=5 A = 0 0 ...

mehr als 9 Jahre vor

Gelöst


Create an anti-identity matrix
Create an anti-identity matrix of given dimension. Examples n = 2 A = [0 1; 1 0] n = 3 A = [0 0 1; 0 1 0; 1 0 0...

mehr als 9 Jahre vor

Gelöst


Find Out sum of principal diagonal element of given matrix
Find out sum of principal diagonal element of given matrix If A=[1 0 0; 0 1 0;0 0 1], then answer must be 3.

mehr als 9 Jahre vor

Gelöst


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

mehr als 9 Jahre vor

Gelöst


Performance - summation
Given a vector of natural numbers x = [1,2,3,...,N] compute the sum of its elements by not stressing the machine too much...

mehr als 9 Jahre vor

Gelöst


Sum all integers from 1 to 2^x
Given a number x, your function must return the summation of all integers from 1 to 2^x.

mehr als 9 Jahre vor

Gelöst


Sum of the Multiplication of Vectors
Given the vectors x and y as input, multiply the vectors and return the summation of its elements. Example: x = [1 2 ...

mehr als 9 Jahre vor

Gelöst


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

mehr als 9 Jahre vor

Gelöst


Summation of array
Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

mehr als 9 Jahre vor

Gelöst


Modify an array's elements
Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. ...

mehr als 9 Jahre vor

Gelöst


Sum function: Counting cookies
Row array troopCookieSales contains the number of boxes of cookies sold by each troop member. Assign totalSales with the sum of ...

mehr als 9 Jahre vor

Gelöst


Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given amountToChange, ...

mehr als 9 Jahre vor

Mehr laden