Gelöst


Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

fast 9 Jahre vor

Gelöst


Palindrome Check
Check whether the entire matrix is palindrome or not. Example matrix = [7 8 7] matrix_reverse = [7 8 7] So the mat...

fast 9 Jahre vor

Gelöst


Matlab Basics - Assigning Variables
Assign different types of data to variables: integer, double, and strings Example: A is a double, for example 2.34 B is a...

fast 9 Jahre vor

Gelöst


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

fast 9 Jahre vor

Gelöst


Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

fast 9 Jahre vor

Gelöst


Alkane
Given a number, x, that is equal to the number of carbon atoms in an <http://en.wikipedia.org/wiki/Alkane alkane>, find, y, the ...

fast 9 Jahre vor

Gelöst


Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

fast 9 Jahre vor

Gelöst


Are you in XY plane?
Take a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0. Example...

fast 9 Jahre vor

Gelöst


prime test
find largest 2 digit prime number

fast 9 Jahre vor

Gelöst


ベクトルのスケーリング
入力したベクトルの大きさを1にしてください。

fast 9 Jahre vor

Gelöst


What is the distance from point P(x,y) to the line Ax + By + C = 0?
Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

fast 9 Jahre vor

Gelöst


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

fast 9 Jahre vor

Gelöst


Let's see how peculiar we can get
The task is to multiply two numbers. But do it in the most peculiar possible way.

fast 9 Jahre vor

Gelöst


Summation of array
Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

fast 9 Jahre vor

Gelöst


find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

fast 9 Jahre vor

Gelöst


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

fast 9 Jahre vor

Gelöst


ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
MATLABでは,角括弧の中に要素を入れることで、ベクトルを作成できる。 x = [1 2 3 4] また次のようにも書ける(コンマはオプション)。 x = [1, 2, 3, 4] 問題:次のベクトルを出力する関数を作成せよ。...

fast 9 Jahre vor

Gelöst


Check if equal
Return true if all the elements of an nD array are equal, false otherwise.

fast 9 Jahre vor

Gelöst


Find and replaces spaces from a input string with *
For a given input string str, find how many spaces are there in the string and replace those spaces with * e.g. str = 'this is ...

fast 9 Jahre vor

Gelöst


Penny flipping - calculate winning probability (easy)
Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

fast 9 Jahre vor

Gelöst


Write a code that will follow the equation y = x * (x + x) * x.
If x = 5, y = 5 * (5+5) * 5 = 250

fast 9 Jahre vor

Gelöst


Calculate distance travelled when given radius and rotations
When given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14

fast 9 Jahre vor

Gelöst


Element by element multiplication of two vectors
Given two input vectors, return the element-by-element product. Example A = [1 2 3] B = [7 3 1] The answer should be...

fast 9 Jahre vor

Gelöst


Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

fast 9 Jahre vor

Gelöst


Box!
Given a box, find the volume of the cube. With each side = a.

fast 9 Jahre vor

Gelöst


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

fast 9 Jahre vor

Gelöst


Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.

fast 9 Jahre vor

Gelöst


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

fast 9 Jahre vor

Gelöst


factorial of a number x
Factorial of a number x

fast 9 Jahre vor

Gelöst


y equals x divided by 2
function y = x/2

fast 9 Jahre vor

Mehr laden