A résolu


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

5 mois il y a

A résolu


Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

5 mois 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

5 mois il y a

A résolu


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

5 mois il y a

A résolu


Square wave average calculation
Given its peak and duty cycle, calculate avg value of square wave

5 mois il y a

A résolu


Average of square wave
given positive and negative peak , calculate dc level, 50% duty cycle

5 mois il y a

A résolu


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

5 mois il y a

A résolu


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

5 mois il y a

A résolu


Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

5 mois il y a

A résolu


Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

5 mois il y a

A résolu


square root
Find the square root (y) of an input (x).

5 mois il y a

A résolu


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

5 mois il y a

A résolu


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

5 mois il y a

A résolu


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

5 mois il y a

A résolu


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

5 mois il y a

A résolu


Product of elements in row
Product of matrix such that a=[3 3 1] b=9

5 mois il y a

A résolu


Integer or Float?
Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise ret...

5 mois il y a

A résolu


Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...

5 mois il y a

A résolu


Who has power to do everything in this world?
There is only one person who is older than this universe. He is Indian version of Chuck Norris.

5 mois il y a

A résolu


Palindrome numbers
Find the palindrome numbers (two or more digits) from 1 to n where n is the number passed to the function.

5 mois il y a

A résolu


Find the area of the four walls
If length, breadth and height of the walls are given, find the area of the four walls.

5 mois il y a

A résolu


Create the following sequence : 0 1 1 4 9 25 64 169 ...
The sequence 0, 1, 1, 4, 9, 25, 64, 169, ... represents the square of the sequence of Fibonacci numbers. Let n repres...

5 mois il y a

A résolu


Palindrome Check
Check whether the entire matrix is palindrome or not. Example matrix = [7 8 7] matrix_reverse = [7 8 7] So the mat...

5 mois il y a

A résolu


Reverse a matrix
Its simple. You have to reverse a given matrix.

5 mois il y a

A résolu


find whether it is prime or not
For a given number find if its prime

5 mois il y a

A résolu


Rotate a matrix for 180 degree
Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

5 mois il y a

A résolu


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

5 mois il y a

A résolu


Find the sum of n squares
What is the sum of the squares of the first n integers?

5 mois il y a

A résolu


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

5 mois il y a

A résolu


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

5 mois il y a

Charger plus