解決済み


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

20日 前

解決済み


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

20日 前

解決済み


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

20日 前

解決済み


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

20日 前

解決済み


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

20日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


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

21日 前

解決済み


Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

21日 前

解決済み


No Fives Permitted
Create a function that gives users an custom error message if the matrix A contains a five. The error message should say "No Fiv...

21日 前

解決済み


A Fiveless Factorial
Given a positive integer x, compute its factorial y, but exclude any muliplication by five if applicable.

21日 前

解決済み


Don't Include a Five (Part Two)
Given a vector A with at least one non-five, return vector B, with all fives excluded (not replaced by zeros).

21日 前

解決済み


Don't Include a Five
Given a vector A, return vector B with all 5s replaced with 0s.

21日 前

解決済み


High Five!
Write a function that takes a number x and returns y = 'High Five' if x is not equal to five. Return y = 'Denied' if the number ...

21日 前

解決済み


A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...

21日 前

解決済み


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

24日 前

解決済み


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...

24日 前

解決済み


Basic Mathematics 1
If a robot is traveling on a north heading at v1 inches per second and has the ability to only make N degree changes in directio...

24日 前

解決済み


Linear Motion 7
A robot has a maximum rate of acceleration of a m/s2. If the robot starts from rest and reaches a velocity of v2 m/s. How far ha...

24日 前

解決済み


Linear Motion 6
An experimental vehicle traveling at v1 m/s is brought to a full stop in t seconds. How far does it travel before stopping? Roun...

24日 前

解決済み


Linear Motion 5
A robot moving down an incline for 3 seconds undergoes a uniform acceleration of a ft/s2. If the robot has an initial velocity o...

24日 前

解決済み


Linear Motion 4
A robot accelerates at a rate of A ft/s2. Assuming the robot starts from rest how much time is required to reach an object loca...

24日 前

解決済み


Linear Motion 3
Suppose a robot is moving in a straight line and steadily increases its speed. It moves from v1 ft/s to v1+2 ft/s in the first ...

24日 前

解決済み


Linear Motion 2
During testing in the desert, a remotely operated vehicle travels D kilometers over rough terrain. The testing takes place over...

24日 前

解決済み


Linear Motion 1
An object travels N feet in the first second of travel, N feet again during the second second of travel and N feet again during ...

24日 前

さらに読み込む