Solved


The Deadly Sin
Melvyn and Banner are fighting over chocolates. Melvyn has X chocolates, while Banner has Y. Whoever has a lesser number of choc...

5 years ago

Solved


Counting Squares
An algorithm starts with a single square and on each of its next iterations adds new squares all around the outside as shown bel...

5 years ago

Solved


Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

5 years ago

Solved


Seperate array to small section according to its index position
Given a integer n, we can generate a sequence [0,1,2,3,4,..., 2^n-1], then we separate it to two sequence according to their ind...

5 years ago

Solved


New Matrix with vector addition on diagonal
consider 2 vectors x=[1 2 3] y=[4 5 6] then generate a new Matrix, where Addition of x & y will be diagonal Elements...

5 years ago

Solved


Find the area of a triangle having vertices (A,B), (C,D), and (E,F)
Find the area of a triangle using if we have the three vertices of the triangle

5 years ago

Solved


Pizza order
A pizza order by phone in diameter d1, pizza will be make only in diameter d2. Return the pizza pieces p should be make.(pizza ...

5 years ago

Solved


Amicable numbers
Test whether two numbers are <https://en.wikipedia.org/wiki/Amicable_numbers amicable>, meaning that the sum of the proper divis...

5 years ago

Solved


Lunar Arithmetic (Addition)
<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit. Example 1: ...

5 years ago

Solved


Make an anonymous function that has variable output
Make a anonymous function that has variable output. f = @(x)... the following equation→equation(s) as followed has(ve) ...

5 years ago

Solved


Optimization of cylinder surface area
Optimization of a cylinder surface area. What are the best parameters (radius and height) to get the minimum cylinder surface a...

5 years ago

Solved


Cody Problems in French : Trouvez la logique Pt.1
On rentre x = 4 et il en sort y = 160. Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage. P.S: L'...

5 years ago

Solved


X O X O
On a noughts and crosses board, how many possible unique combinations are there given a square grid of length n? Assumptions/...

5 years ago

Solved


X O X Oh!
_This follows on from problem 44850 - X O X O_ <https://www.mathworks.com/matlabcentral/cody/problems/44850-x-o-x-o> On a...

5 years ago

Solved


Mean number of letters per word (Easy)
Given a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the give...

5 years ago

Solved


Mean number of letters per word (Hard)
The previous problem in this series is <https://www.mathworks.com/matlabcentral/cody/problems/44852-mean-number-of-letters-per-w...

5 years ago

Solved


Permutation Via Multiplication
Given two numbers a and b, determine if the product ab is a permutation of the digits of a. For example, this is always true for...

5 years ago

Solved


CowBoy
A group of cowboys standing in circle form. They have one gun. The first cowboy shoot the cowboy beside him (second one) and giv...

5 years ago

Solved


Create a 3D rotation matrix
Consider an arbitrary coordinate frame {A}. Consider another coordinate frame {B} which has the same origin as {A} but is rotat...

5 years ago

Solved


Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.
Given a matrix x, *using loops only* return a matrix y, in which all the zeros have "climbed" up to the top. That is, any zeros ...

5 years ago

Solved


Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...

5 years ago

Solved


Float like a cannonball
Given gravity on earth (g=9.81 [m/s/s]) find the distance s [m] by a cannonball propelled at a speed of u [m/s] from the origin ...

5 years ago

Solved


What time can I drive after drinking?
At T o'clock, after a hard day of Matlab, I immediately start drinking and treat myself to N pints of tasty beer. Each beer I dr...

5 years ago

Solved


An n-sided regular polygon is drawn within a circle whose radius is 'r', what will be the area of the polygon?
area of a polygon is p*a/2. where, p is the perimeter and a is the apothem i.e. the normal distance from center to any of the ...

5 years ago

Solved


Determine whether a given point is inside or outside a polygon
A closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of ...

5 years ago

Solved


find subscripts from linear index
a matrix and the linear index of an element is given as input. find the subscripts of that element. if linear index=3 , outp...

5 years ago

Solved


cofactor matrix
given a matrix, find its cofactor matrix <https://en.wikipedia.org/wiki/Minor_(linear_algebra)#Inverse_of_a_matrix>

5 years ago

Solved


Wythoff Sequence
Find the lower Wythoff sequence up to n. For more information, <https://oeis.org/A000201>

5 years ago

Solved


Remove duplicated triangles
Input T is a triangulation (triplet list of indices -positive integers-, each index refering to a vertex number in a correspondi...

5 years ago

Load more