Solved


State of Charge (SoC) Estimation for a Battery
The State of Charge (SoC) of a battery represents its remaining charge as a percentage. It can be calculated using the formula: ...

6 days ago

Solved


Battery Life Estimation for a Device
A battery-powered device consumes a constant current while operating. The estimated battery life (T) can be calculated using the...

6 days ago

Solved


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

6 days ago

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

6 days ago

Solved


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

6 days ago

Solved


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

6 days ago

Solved


Convert radians to degrees
Given input in radians, output to degrees

6 days ago

Solved


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

6 days ago

Solved


Create a vector
Create a vector from 0 to n by intervals of 2.

9 days ago

Solved


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

9 days ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

9 days ago

Solved


Pandigital number n°1 (Inspired by Project Euler 32)
A little warm-up to begin... An n-digit number is pandigital if it makes use of all the digits 1 to n exactly ONCE. For ex...

9 days ago

Solved


Pandigital number n°2 (Inspired by Project Euler 32)
After Problem 2319. An n-digit number is pandigital if it makes use of all the digits 1 to n exactly ONCE. For example, the 5-...

9 days ago

Solved


Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the P...

9 days ago

Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

9 days ago

Solved


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

9 days ago

Solved


Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...

9 days ago

Solved


Sieve of Eratosthenes - 02
"Sift the Two's and Sift the Three's, The Sieve of Eratosthenes. When the multiples sublime, The numbers that remain a...

9 days ago

Solved


calculate the length of matrix
input 1 array, calculate the length

9 days ago

Solved


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

9 days ago

Solved


Graph Algorithms 3: Number of Connected Components
Given an adjacency matrix of a simple undirected graph, find the number of connected components.

9 days ago

Solved


FloydWarshall
Our task is to find shortest paths between every pair of nodes. Floyd-Warshall is a graph algorithm for finding shortest paths i...

9 days ago

Solved


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: http://e...

10 days ago

Solved


Distance of the centroids of the balls
Given *n* balls of radius *r* and the vector *p (nx3)* with all position *(x,y,z)* of the balls, return the symmetric matrix *A ...

10 days ago

Solved


Center of mass
Given a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid...

10 days ago

Solved


Energy of an object
Calculate the total mechanical energy of an object. Total Energy= Potential energy + Kinetic energy P.E.=m*g*h K.E.=1/2...

10 days ago

Solved


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

10 days ago

Solved


Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

10 days ago

Solved


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

10 days ago

Solved


Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

10 days ago

Load more