Solved


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

4 years ago

Solved


Sum of first n positive integers
Given n, find the sum of first n positive integers Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55

4 years ago

Solved


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

4 years ago

Solved


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

4 years ago

Solved


Area of a Square
Given the length x of the side of a regular square, find the area of the square, A.

4 years ago

Solved


Test

4 years ago

Solved


Product of elements in row
Product of matrix such that a=[3 3 1] b=9

4 years ago

Solved


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

4 years ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

4 years ago

Solved


Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative

4 years ago

Solved


Repeat elements of a vector
Repeat each elements of a given vector according to their values. * x=[1,2,1,3] * y=[1,2,2,1,3,3,3]

4 years ago

Solved


Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...

4 years ago

Solved


Schwarzschild radius
Compute the Schwarzschild radius for objects of mass m (kg). Use c = 299,792.458 km/s and G = 6.6738*10^-11 N*(m/kg)^2. Your fun...

4 years ago

Solved


Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

4 years ago

Solved


Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

4 years ago

Solved


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

4 years ago

Solved


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

4 years ago

Solved


The maximum sum of squares
Create a function file with an input maxval to determine the maximum number of terms for the series 1^2 + 2^2 + 3^2 + ... such t...

4 years ago

Solved


find the surface area of a cube
given cube side length x, find the surface area of the cube, set it equal to y

4 years ago

Solved


Array of Ones
Create a 100 X 100 array of ones.

4 years ago

Solved


How many jokers?
* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

4 years ago

Solved


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

4 years ago

Solved


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

4 years ago

Solved


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

4 years ago

Solved


Building matrices
If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

4 years ago

Solved


Golden ratio
Calculate the golden ratio. Hint: phi^2 = phi + 1.

4 years ago

Solved


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

4 years ago

Solved


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

4 years ago

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

4 years ago

Load more