Solved


Binary
Given a positive, integer n, create a function that returns the respective binary number in the form of a vector. Example: ...

mer än 7 år ago

Solved


Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

mer än 7 år ago

Solved


Calculate the height of an object dropped from the sky
Assume that an object is dropped from 1000 meters above the surface of the earth at time t=0. The object is dropped such that t...

mer än 7 år ago

Solved


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

mer än 7 år ago

Solved


Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.

mer än 7 år ago

Solved


How many monitors are connected ?
How to obtain the numbers of monitors connected to your computer ?

mer än 7 år ago

Solved


Matlab Basics II - Minimum
Write a function that returns the minimum of each ROW of a matrix x example: x = [1 2 3; 4 5 6]; output [1;4];

mer än 7 år ago

Solved


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

mer än 7 år ago

Solved


Next Higher Power of B
|Given a number _n_ and a base _B_ greater than 1, return the lowest integer power of _B_ that is greater than or equal to _n_. ...

mer än 7 år ago

Solved


Travel speed
Write an anonymous function to compute the Euclidean distance given two points (x1, y1) and (x2, y2). Use the following equation...

mer än 7 år ago

Solved


Prime checker
Complete the recursive function to determine if a number is prime. Skeletal code is provided in the PrimeChecker function.

mer än 7 år ago

Solved


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

mer än 7 år ago

Solved


Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

mer än 7 år ago

Solved


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

mer än 7 år ago

Solved


Sum of diagonals elements of a matrix
Given a matrix, return the sum of all the elements across the diagonals. E.g. A = [1 2 3; 4 5 6; 7 8 9;...

mer än 7 år ago

Solved


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

mer än 7 år ago

Solved


Count decimal digits of a number
* Given an integer number you have to return the number of its digits. * For example 248 has 3 digits and 1589 has 4 digits ...

mer än 7 år ago

Solved


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

mer än 7 år ago

Solved


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

mer än 7 år ago

Solved


Calculate the derivative of a polynomial
Example: in = [ 1 1 1 ] out = [ 2 1 ]

mer än 7 år ago

Solved


Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

mer än 7 år ago

Solved


Finding values in arrays
Assign numMatches with the number of elements in userValues that equal matchValue. Ex: If matchValue = 2 and userVals = [2, ...

mer än 7 år ago

Solved


Convert from Base 10 to base 5
Convert the input number from base 10 into base 5: for example: if a(in base 10)= 5 then a(in base 5)= 10

mer än 7 år ago

Solved


The Dark Side of the Die
It is well-known that opposite sides of a classic hexahedral die add to 7. Given a vector of dice rolls, calculate the sum of th...

mer än 7 år ago

Solved


Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

mer än 7 år ago

Solved


If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

mer än 7 år ago

Solved


Number of pennies
Complete the function ConvertToPennies() so that the function returns the total number of pennies given a number of dollars and ...

mer än 7 år ago

Solved


Function call: Kilometers to miles
Assign rateMPH with the corresponding rate in miles per hour given a user defined rateKPH, which is a rate in kilometers per hou...

mer än 7 år ago

Solved


Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

mer än 7 år ago

Solved


Writing a recursive math function
Complete the recursive function RaiseToPower(). Ex: If userBase is 2 and userExponent is 4, then raisedValue is assigned wit...

mer än 7 år ago

Load more