Gelöst


sinus function
x is the abscissa. find the absolute value of cosine of -x and the same value with changed sign.

mehr als 10 Jahre vor

Gelöst


Logical operators and arrays: 3-input and truth table
Given 3 inputs (inputA, inputB, inputC), assign threeInputAnd with the truth table outcomes for a 3 variable logical-and operati...

mehr als 10 Jahre vor

Gelöst


Compute Fibonacci Number
Compute the _n_-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

mehr als 10 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

mehr als 10 Jahre vor

Gelöst


frame of the matrix
Given the matrix M, return M without the external frame.

mehr als 10 Jahre vor

Gelöst


Logical operators: Flipping bits
The xor operator will toggle the bit if the bit is xored with 1. Ex: 1 XOR 0 = 1, 1 XOR 1 = 0. The xor operator will retain th...

mehr als 10 Jahre vor

Gelöst


Function definition: BMI calculator
Define a function CalculateBMI with inputs massKg and heightCm. The function returns bodyMassIndex. The function should be able ...

mehr als 10 Jahre vor

Gelöst


Elapsed time is -0.005204 seconds.
Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case p...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Negative Infinity
Round the given array a towards negative infinity.

mehr als 10 Jahre vor

Gelöst


Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

mehr als 10 Jahre vor

Gelöst


Concatenate two strings
Its very easy. Just concatenate two strings.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Area of a Square
Inside a square is a circle with radius r. What is the area of the square?

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Nth root.
* Assign outValues with the nth root of the inValues, the root is specified by rootValue

mehr als 10 Jahre vor

Gelöst


poll: would you like the regexp (?@cmd) functionality to be banned in Cody?
This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of rege...

mehr als 10 Jahre vor

Gelöst


Narcissistic number ?
Inspired by Problem 2056 created by Ted. In recreational number theory, a narcissistic number is a number that is the sum of ...

mehr als 10 Jahre vor

Gelöst


Logical variables: Running late?
* Assign onTime with true if noTraffic is true and gasEmpty is false.

mehr als 10 Jahre vor

Gelöst


reverse string
input='rama' output='amar'

mehr als 10 Jahre vor

Gelöst


Add a row of zeros on top of a matrix
Given a matrix, insert a row of zeros as the top row.

mehr als 10 Jahre vor

Gelöst


Roots
Find out the roots of a given polynomial equation.Given are the coefficients of the equation.

mehr als 10 Jahre vor

Gelöst


Factorial Numbers
Factorial is multiplication of integers. So factorial of 6 is 720 = 1 * 2 * 3 * 4* 5 *6 Thus 6 factorial = factorial(720)....

mehr als 10 Jahre vor

Gelöst


Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Mehr laden