A résolu


Find the nearest prime
Given a positive integer 'n', the task is to find a prime number greater than or equal to 'n'. Example 1 If given 'n' is ...

plus de 7 ans il y a

A résolu


Throw common elements of two vector arrays
Throw common elements as output of two given input vector arrays

plus de 7 ans il y a

A résolu


find a specific element from an matrix
Find the element from matrix which is in 2nd row and 3rd column.

plus de 7 ans il y a

A résolu


Reverse CHECKBOX MATRIX with 69
Create a reverse checkbox matrix with '69'. Where the size is the input and output will be a square checkbox matrix. Exa...

plus de 7 ans il y a

A résolu


Remove and Sort
Given a randomized array n, sort it and remove all odd integers. n=5 y = [2 4]

plus de 7 ans il y a

A résolu


Zero Cross
Write a function that counts the number of times n a signal x changes sign. Examples x = [1 2 -3 -4 5 6 -7 8 -9 10 11] ...

plus de 7 ans il y a

A résolu


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

plus de 7 ans il y a

A résolu


Test if a number is numeric or not
Test if a number is numeric or not

plus de 7 ans il y a

A résolu


Matrix with different incremental runs
Given a vector of positive integers a (>=0); How does one create the matrix where the ith column contains the vector 1:a(i) poss...

plus de 7 ans il y a

A résolu


Matlab Basics II - Log and natural log
Write a function that calculates the difference between the log and natural log of a vector, to two decimal places example: ...

plus de 7 ans il y a

A résolu


create a circulant matrix
create a circulant matrix

plus de 7 ans il y a

A résolu


Angle of triangle
For three unknown points a b c, given three sides ab bc ca, find three angles abc bca cab in radians. Your function should b...

plus de 7 ans il y a

A résolu


Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||. Hint: It is as simple as "ABC".

plus de 7 ans il y a

A résolu


Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

plus de 7 ans il y a

A résolu


Calculate the height of an object dropped from the sky
Assume that an object is dropped from 1000 meters above the surface of the earth at time t=0. The object is dropped such that t...

plus de 7 ans il y a

A résolu


Area of rhombus
Calculate the rhombus area

plus de 7 ans il y a

A résolu


Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector. Every element s(i) cont...

plus de 7 ans il y a

A résolu


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

plus de 7 ans il y a

A résolu


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

plus de 7 ans il y a

A résolu


Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

plus de 7 ans il y a

A résolu


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

plus de 7 ans il y a

A résolu


Circle/Pentagon Overlap
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

plus de 7 ans il y a

A résolu


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

plus de 7 ans il y a

A résolu


Raise each element to the power of its index in a matrix
In a matrix, A = [1,2;3,4] raise the power of each element like: 1^1+2^3+3^2+4^4 and add it all to produce the result 274

plus de 7 ans il y a

A résolu


Pass the Threshold!!
Write a Matlab function that will take as input a matrix of arbitrary dimensions and a scalar threshold value, and return a vec...

plus de 7 ans il y a

A résolu


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

plus de 7 ans il y a

A résolu


Reverse the Matrix
Given a Matrix A, reverse it. Such that, last element of A becomes 1st and vice versa. for example: Input = [1 2 3;4 5 ...

plus de 7 ans il y a

A résolu


Return all matrix elements except elements on diagonal
Consider a given Matrix A=[a b c; d e f; g h i] then return a row vector T such that it contains all the El...

plus de 7 ans il y a

A résolu


You never ask a lady her age
Instead you ask her to multiply her age by 10, then subtract any of the first nine multiples of 9 (9,18,...,81), and tell you th...

plus de 7 ans il y a

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

plus de 7 ans il y a

Charger plus