Resuelto

Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

alrededor de 7 años hace

Resuelto

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

alrededor de 7 años hace

Resuelto

Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

alrededor de 7 años hace

Resuelto

Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

alrededor de 7 años hace

Resuelto

Given a and b, return the sum a+b in c.

alrededor de 7 años hace

Resuelto

Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

alrededor de 7 años hace

Resuelto

Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

alrededor de 7 años hace

Resuelto

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

alrededor de 7 años hace

Resuelto

Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

alrededor de 7 años hace

Resuelto

Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

alrededor de 7 años hace

Resuelto

Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

alrededor de 7 años hace

Resuelto

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

alrededor de 7 años hace

Resuelto

~(*|/)
Return three quarters of n without using addition, subtraction, multiplication or division.

alrededor de 7 años hace

Resuelto

Reverse a string
Reverse the given string. Example input = 'reverse' output = 'esrever'

alrededor de 7 años hace

Resuelto

Determine if input is divisible by three.
Given a positive integer, n, determine if n is divisible by 3. If yes, the function should output true. If no, false.

alrededor de 7 años hace

Resuelto

Bridge toll
Complete the example to calculate finalToll. The base toll for a bridge is baseToll. If the vehicle's weight is over 5,000 pound...

alrededor de 7 años hace

Resuelto

Food safety
Assign safeTemperature with 1 if foodTemperature is less than 40 or greater than 165.

alrededor de 7 años hace

Resuelto

Preset rpm speeds
A centrifuge has four preset speeds. Write a switch statement that assigns rpmSetting with the appropriate rpm speed given prese...

alrededor de 7 años hace

Resuelto

Insect population
An insect population doubles every generation. * Write a while loop that iterates numGeneration times. * Write a statment ...

alrededor de 7 años hace

Resuelto

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

alrededor de 7 años hace

Resuelto

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

alrededor de 7 años hace

Resuelto

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

alrededor de 7 años hace

Resuelto

Find Missing Number
A little problem (inspired by CodeChef) for the coffee break. A friend give you an array of size n-1 integers and these int...

alrededor de 7 años hace

Resuelto

Make visible max values
Make visible maximum values of rows input = [1 2 3 4 5; 6 9 8 2 1; 2 1 4 5 8; 1 9 7 9 2]; ...

alrededor de 7 años hace