Solved


Sum the entries of each column of a matrix which satisfy a logical condition.
Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

5 years ago

Solved


grazing cows
Here is a fun problem I encountered in high school. Two cows are grazing in an enclosed square-shaped field of side length s ...

5 years ago

Solved


La derivada numérica
El concepto de pendiente o inclinación de una función recta es muy intuitivo para cualquier persona. Desde el punto de vista mat...

5 years ago

Solved


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people i...

5 years ago

Solved


Back to basics 20 - singleton dimensions
Covering some basic topics I haven't seen elsewhere on Cody. Remove the singleton dimensions from the input variable (e.g. if...

5 years ago

Solved


How many complete pizzas
x is a vector with numbers of pizza slices. A corresponding vector n indicates in how many slices the pizza slices of x were cut...

5 years ago

Solved


Chicken Race
2 chickens, Pete and Fred, compete in a 100 meter race. Pete runs at a velocity of vp meter/second and Fred is slower, running ...

5 years ago

Solved


Yoonir - 02
Find the area of a six-pointed star inscribed in a circle of radius r.

5 years ago

Solved


Yoonir - 03
Find the area of a seven-pointed star inscribed in a circle of radius r.

5 years ago

Solved


Odd times even numbers in a matrix
First count the number of odd numbers in x, then the number of even. Return their product. example: x = [1 2] One odd ...

5 years ago

Solved


All odd - all even
All odd numbers in x are added, while all even numers are subtracted from this. example: x = [1 2 3 4 5]; y = +(1+3+5)-...

5 years ago

Solved


Given a number find two variables
If the input is *x*, find *a* and *b* from the following equation: *x = a*2^b*. Hint: *b* is an integer while *x* and *a* ar...

5 years ago

Solved


mathematics , probability problem
How many different result can we have, rolling k dice?

5 years ago

Solved


Colon operator of two vectors
You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

5 years ago

Solved


Generate binary combinations for a given number of bit(s)
Generate the binary combination as in the example below. Example: If you are given: bin_comb(2) The answer will be: ...

5 years ago

Solved


Are all the three given point in the same line?
In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

5 years ago

Solved


Diagonal & Anti-Diagonal Matrix: Easy
Create a matrix as shown below from "magic" square. For example: if input x=9;then use mgic(x) and create the matrix...

5 years ago

Solved


Sort the prime numbers in each row of a 3x3 matrix
Considering a 3x3 matrix A, sort the prime numbers of each row in ascending order. For exemple: input A=[5 8 2 4; ...

5 years ago

Solved


Find the position of last minimum value in an integer array with numbers
If x = [2 6 4 9 -10 3 1 5 -10] then the output should be 9, because last minimum value (-10) lies at the 9th position.

5 years ago

Solved


Least common multiple of many numbers
1:6 -> 60

5 years ago

Solved


Binary Inversion
Given the unsigned 8-bit integer x, return the number y which is the binary inversion of x. For example if x is 5, y should b...

5 years ago

Solved


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

5 years ago

Solved


Leap Year
According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...

5 years ago

Solved


Permutation
How many different words can be formed using all the letters(together) from a given input word? Input is a string.

5 years ago

Solved


Area-07
This is a follow up of the problem <https://www.mathworks.com/matlabcentral/cody/problems/45341-area-06> in this case, fi...

5 years ago

Solved


Area-06
The length of the side of a square is given. Draw 4 quarter-circles inside the square from 4 corners with a radius equal to t...

5 years ago

Solved


Grazing-02
A cow is tied to an outside corner of a rectangular barn of size (a,b) with a rope of length l. What is the maximum area the cow...

5 years ago

Solved


Grazing-01
A cow is tied to an outside corner of a rectangular barn of size (a,b) with a rope of length l. What is the maximum area the cow...

5 years ago

Solved


Spherical radius given four points
Determine the radius of a sphere provided four non-coplanar points on the surface of the sphere. pts = [x1 y1 z1; x...

5 years ago

Load more