Solved

Isothermal Expansion
Given the initial pressure and volume of an ideal gas, calculate the new volume, given the new pressure. Hint: <https://en.wi...

3 years ago

Solved

Sum two real numbers
It seems easy, but... You cannot use +, -, plus, diff, cumsum, *, prod, times, etc.

3 years ago

Solved

generate number in particular way
A = [1 5 2 7]; MAX = 10; generate a array Y = [1 2 2 2 2 2 3 3 4 4]; i.e. total eleme...

3 years ago

Solved

Detect pair of equal values in a Matrix
A 2D matrix of 2 rows and N columns with random integer numbers. A = [3 1 2 4 6 6 7; 7 3 2 1 5 2 4] ...

3 years ago

Solved

Juggler sequence revisited
This problem is related to <http://www.mathworks.com/matlabcentral/cody/problems/42835-return-the-sequence-element-ii Problem 42...

3 years ago

Solved

most frequent character
Obtain most frequent character Let s='balaram'; output='a';

3 years ago

Solved

Babylonian method
Calculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_co...

3 years ago

Solved

center of mass
R is a given matrix with size [n,2]. R(i,:) is interpreted as the 2D-position of a mass point with mass i. Calculate the center ...

3 years ago

Solved

Fast 1-D Convolution (full shape)
This is the first problem in the <http://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution fast 1-D convolution se...

3 years ago

Solved

house of cards
How many cards do one need to build a house of cards with n stages? Short explanation: /\ 2 cards for 1 stage ...

3 years ago

Solved

Approximate e
Given a and n, compute and approximation to f = a * e ^ n, without the use of exp, string operations, or floating point numbers....

3 years ago

Solved

means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

3 years ago

Solved

Sum of Logarithms
Given a vector, v, of real positive numbers, compute the sum, s, of the base-10 logarithms of the elements of v, without the use...

3 years ago

Solved

Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

3 years ago

Problem

Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

3 years ago | 1

Solved

How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

3 years ago

Solved

Regular polygon bounded by and bounding a circle
As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area ...

3 years ago

Solved

Raise a polynomial to a power
In Matlab, polynomials are represented by a vector of coefficients. For example, the polynomial p=a*x^2 + b*x + c is represente...

3 years ago

Solved

the "power matrix" of two vetcors
Given two row vectors x,y of lengths m and n (resp.), create an m x n matrix whose i,j entry is x(i)^y(j).

3 years ago

Solved

Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...

3 years ago

Solved

Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

3 years ago

Solved

Is 3D point set Co-Planar?
This Challenge is to determine if four 3D integer points are co-planar. Given a 4x3 matrix representing four x,y,z integer poin...

3 years ago

Solved

Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

3 years ago

Solved

Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

3 years ago

Solved

Find the gcm of n given values
Create a function that given n integer values greater than zero, finds the two numbers with the greatest common divisor and retu...

3 years ago

Solved

Find the next square number
Given one or more integers n, find the next integer that is a square, for each of them. Example 1: n = 1; out = 4; ...

3 years ago

Solved

Number of vertices of a hypercube
Return the number of vertices of a n-dimensional hypercube.

3 years ago

Solved

Low level NaN
* I have a dataset. Columns represents different variables. * A variable may start with NaN or any double type number. * If i...

3 years ago

Solved

Polygonal numbers
The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

3 years ago

Solved

Oh Zero Zero Zero!!!
Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

3 years ago