Solved


Prime number check (★★)
One way to see if a number x is prime is to compute the remainders obtained when dividing x by all integers from 2 to √(x). If x...

1 month ago

Solved


Determinant of a 3x3 Matrix
Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.

1 month ago

Solved


Check if a year is a leap year or not
Return 1 if a given year is a leap year or 0 if it is not

1 month ago

Solved


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

1 month ago

Solved


Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...

1 month ago

Solved


Power of n ?
Determine if x (positive integer) is a power of n, return true or false accordingly.

1 month ago

Solved


Calculate sin(x) without sin(x)
Calculate y = sin(x) x = 0 -> y= 0 without the use of sin(x) or cos(x)

1 month ago

Solved


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

1 month ago

Solved


Linear Motion 7
A robot has a maximum rate of acceleration of a m/s2. If the robot starts from rest and reaches a velocity of v2 m/s. How far ha...

1 month ago

Solved


Linear Motion 6
An experimental vehicle traveling at v1 m/s is brought to a full stop in t seconds. How far does it travel before stopping? Roun...

1 month ago

Solved


Number Puzzles - 006

1 month ago

Solved


Rotate matrix by coloumns

1 month ago

Solved


Grandpa's telescope
Two grandkids Dorothy and Benjamin are sharing a telescope made by their grandpa, who used an old lens of spectacles as the obje...

1 month ago

Solved


Opposite point of the earth, what is the antipodal of a point ?
Given two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is ...

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

1 month ago

Solved


Jack's hand in "Titanic" ♤
Given a series of cards, return true if it's the famous hand. Note that i pretend that poker cards goes from 1 to 10 so be care...

1 month ago

Solved


balance vector
Given a non-empty vector x with integer elements. x shall be called balance vector if one can split the elements of x into two g...

1 month ago

Solved


Perl 2: pop
This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab? ...

1 month ago

Solved


Periodic Table II 101.
Given the symbol of an element, return its atomic number. This is the continuation of <http://www.mathworks.com/matlabcentral/co...

1 month ago

Solved


Cricket - How Much More to Beat Bradman?
Sir Don Bradman famously needed only 4 runs in his final innings to retire with an average of 100. Out for a duck, he ended inst...

1 month ago

Solved


Scrabble Scores - 2
An <https://www.mathworks.com/matlabcentral/cody/problems/56-scrabble-scores introductory Cody problem> asks the user to score a...

1 month ago

Solved


Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

1 month ago

Solved


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

1 month ago

Solved


Number Puzzle - 094
Give an example of three unique numbers a, b, and c such that concatenating a^2, b^2, and c^2 is equal to d^4 for an integer d.

1 month ago

Solved


is the number happy?
test is a given integer number is Happy of not? answer 1 if yes or 0 is no

1 month ago

Solved


Adjoint matrix
given a matrix a, find the adjoint matrix of a.

1 month ago

Solved


Kurchan 5x5 - Optimal Score
Related to Problems 1646 and 2650, but bigger. Technically, all you need to do for this Cody problem is input a 5x5 matrix conta...

1 month ago

Solved


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

1 month ago

Solved


Resistance of a robot
What is the resistance of an industrial robot that draws P watts of power when connected to a power supply delivering V volts? R...

1 month ago

Solved


Consecutive Powers
Return 2 numbers and 2 powers such that their difference is 1 A 4 element row vector is expected: x where x(1)^x(2) - x(...

1 month ago

Load more