A résolu


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

plus d'un an il y a

A résolu


Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

plus d'un an il y a

A résolu


Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

plus d'un an il y a

A résolu


Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

plus d'un an il y a

A résolu


Numbers with prime factors 2, 3 and 5.
Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...

plus d'un an il y a

A résolu


Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

plus d'un an il y a

A résolu


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

plus d'un an il y a

A résolu


Next Higher Power of B
|Given a number _n_ and a base _B_ greater than 1, return the lowest integer power of _B_ that is greater than or equal to _n_. ...

plus d'un an il y a

A résolu


Change the sign
Given a matrix x, return one with each diagonal element replaced by its absolute value and the largest element in absolute value...

plus d'un an il y a

A résolu


Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

plus d'un an il y a

A résolu


Squaring Matrix
Square the following matrix using matlab % A = 1 2 3 4 5 6 7 8 So new matrix should display...

plus d'un an il y a

A résolu


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

plus d'un an il y a

A résolu


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime numb...

plus d'un an il y a

A résolu


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

plus d'un an il y a

A résolu


Matlab Basics II - squares
Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

plus d'un an il y a

A résolu


Determine the mean of matrix
Determine the mean of matrix without using mean function Hint: use simple algorithm

plus d'un an il y a

A résolu


Determine the square root
Determine the square root of the value the user has entered, n.

plus d'un an il y a

A résolu


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

plus d'un an il y a

A résolu


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

plus d'un an il y a

A résolu


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

plus d'un an il y a

A résolu


Square root of number
Square root of given number.

plus d'un an il y a

A résolu


Perfect Square or not
find Given input x is perfect square or not,if yes then output y=1.else y=0

plus d'un an il y a

A résolu


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

plus d'un an il y a

A résolu


Weave two vectors into one
Weave the two given vectors into one as shown below. Example: If a = [1 1 1] b = [0 0 0] then y = [1 0 1 0 ...

plus d'un an il y a

A résolu


find the maximum element of the matrix
for e.g x = [1 2; 3 4] y = 4

plus d'un an il y a

A résolu


calculate linear convolution two vectors
for e.g in: a = [1 2 3] b = [4 5 6] out: y = [4 13 28 27 18]

plus d'un an il y a

A résolu


Find the minimum element of the matrix
Example: If x = [3 9; 5 2] then y = 2

plus d'un an il y a

A résolu


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

plus d'un an il y a

A résolu


Negative matrix
Change the sign of all elements in given matrix.

plus d'un an il y a

A résolu


convert matrix to single column
given any matrix, convert it to single column

plus d'un an il y a

Charger plus