Solved


Ratio between sum of primes and sum of factors
Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

2 months ago

Solved


Ratio between sums of prime and non-prime numbers
Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

2 months ago

Solved


Sum of a geometric series
Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

2 months ago

Solved


Get the value 100
Knowing that 123-45-67+89=100, write a function that gives this result for any order of the digits in the input. Otherwise, the ...

2 months ago

Solved


Get the mean digit
Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

2 months ago

Solved


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

2 months ago

Solved


Alternating 1´s and 0´s in a matrix
Given an odd number n, write a function that creates a matrix y with dimension nxn alternating 1's and 0's, and starting with 1 ...

2 months 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...

2 months 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...

2 months 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/...

2 months ago

Solved


Given a base n, find the y values less or equal than 100(without 1), such that they will never produce a periodic number if we divide any whole number between some of them
A periodic number depends on the base b where we are working. So, for example the number 2/3 in decimal base is periodic(0.666...

2 months ago

Solved


Approximate the inverse tangent by power series
Given values b (where abs(b)<=1) and n (polynomial order), write a function that calculates atan(b) by using power series.

2 months ago

Solved


Say type of roots in quadratic equation
Given the coefficients of a quadratic equation, write a function that gives the output y='RealDifferent' if the roots are real a...

2 months ago

Solved


Just another norm problem (JANP)
*Task:* Implement a function that takes a square matrix A and returns a nonzero vector yc which minimizes ...

2 months ago

Solved


Just another sum (JAS)
*Task:* Write a function that takes a vector X and returns the alternating sum of X: X(1)-X(2)+X(3)-X(4)+... *Example...

2 months ago

Solved


Moving average
A moving average function that returns an array that is equal in length to the input arrays (which can be row or column) A va...

2 months ago

Solved


Nth Order Polynomial Regression
Inputs: -two vectors x and y (row or column) -order of polynomial, p Outputs: -vector of coefficients [b0 b...

2 months ago

Solved


Double the next!
Given two numbers, m and n, find a matrix [m,n] where each element value is twice the value of the previous element. Starting fr...

2 months ago

Solved


Cody problems in French : Trouvez la logique Pt.2
Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage. P.S: L'utilisation de "^" est de nouveau fortement...

2 months 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'...

2 months ago

Solved


Homogeneous lines and points in 2D: problem 1
In high school we learn the line equation y = mx + c where m is the gradient and c is the intercept. However this form is proble...

2 months ago

Solved


Calculate the square of a number (Super Easy)
The goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.

2 months ago

Solved


Generate Convolution Matrix of 2D Kernel with Different Convolution Shapes (Full, Same, Valid)
In this problem the challenge is to build the Matrix Form equivalent of the function `conv2()` of MATLAB. The function to be ...

2 months ago

Solved


Word Distance - Average Sort
Based on the method of <https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum this problem>, write a fun...

2 months ago

Solved


Add consecutive integer numbers
Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

2 months ago

Solved


Wrecked Angles?
It's time for some simple geometry fun to start off the new year. You will be given the perimeter P and the area A of a recta...

2 months ago

Solved


Find the complement of a number in binary
Input x is a decimal number and output y is the complement of binary representation of x. For example, x = 10 has the binary ...

2 months 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...

2 months ago

Solved


Draw Dominos
Write a function to draw dominos. The number on each side can range from 0 to 9. For example, for an input of [3,7], your functi...

2 months ago

Solved


Cube root of max value in a vector
Find the cube root of the maximum value in a vector

2 months ago

Load more