Risolto


modulus of a number
find the modulus of a given number

circa 10 anni fa

Risolto


Project Euler: Problem 14, Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) U...

circa 10 anni fa

Risolto


Kurchan Square - Evaluation Function
Evaluate a Kurchan square. An NxN square with values 1:N^2. Given a square matrix determine the products of each row, column,...

circa 10 anni fa

Risolto


Find 1's Complement
Find 1's complement of a binary number For Example: x = 10011010 1's complement of x = 01100101

circa 10 anni fa

Risolto


Index one element in each vector of an array along a given dimension
Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

circa 10 anni fa

Risolto


Project Euler: Problem 18, Maximum path sum I
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bott...

circa 10 anni fa

Risolto


Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

circa 10 anni fa

Risolto


Unit conversion
Convert x degree Celsius to y degree Fahrenheit.

circa 10 anni fa

Risolto


ASCII code of a leter.
Given the letter, the output will show the corresponding ASCII code.

circa 10 anni fa

Risolto


Zero Cross
Write a function that counts the number of times n a signal x crosses zero or changes sign. Examples x = [1 2 -3 -4 5 6 ...

circa 10 anni fa

Risolto


Find the inverse permutation
Given a permutation vector perm (a vector of n elements containing all the elements from 1 to n in some order), return the permu...

circa 10 anni fa

Risolto


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

circa 10 anni fa

Risolto


ASCII Code
Using matlab, give the symbol that is associated with ASCii code 90.

circa 10 anni fa

Risolto


Corresponding letter to ASCII code.
Given the letter, the output will show the corresponding ASCII code.

circa 10 anni fa

Risolto


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

circa 10 anni fa

Risolto


Annual Salary
What is the annual salary of Mr. Cody if he works 40 hours a week and gets $x per hour and a yearly bonus of $2000? (Let, 50 wee...

circa 10 anni fa

Risolto


Square root of a number
Write a code that will output the square root of x.

circa 10 anni fa

Risolto


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

circa 10 anni fa

Risolto


Vector with a repeated entry
Create a row vector of length n, filled with 5's. For example, if n = 3, output = [4 4 4] Hint: Search for the function...

circa 10 anni fa

Risolto


Log of a number
Write a script that will give the log of x as output.

circa 10 anni fa

Risolto


Operate on matrices of unequal, yet similar, size
You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

circa 10 anni fa

Risolto


Addition Partition
You will be given two numbers, N and K. Write a MATLAB function that will determine how many different unique ways you can have...

circa 10 anni fa

Risolto


Nth roots of unity
First, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1. <https://en.wiki...

circa 10 anni fa

Risolto


Integer complexity
Given an array, n, of positive integers, return an array, c, of the same size, in which each element is the <https://en.wikipedi...

circa 10 anni fa

Risolto


Pseudo Square Root (Inspired by Project Euler 266)
Shamelessly copied from the Project Euler page for Problem 266: ------------- The divisors of 12 are: 1,2,3,4,6 and 12. T...

circa 10 anni fa

Risolto


Poker Card Deal!
Anyone want to play a card game? Well this is making one deck of cards, with the option of using 2 jokers. The outputs are ...

circa 10 anni fa

Risolto


How Far Can You Throw Something?
As you probably learned in your high school physics class, throwing an object at a 45 degree angle will give you the maximum ran...

circa 10 anni fa

Risolto


Counting the Grand Primes
A grand prime pair is a pair of primes, p1 and p2=p1+1000, such that both numbers are prime. Like a twin prime pair, where the d...

circa 10 anni fa

Risolto


Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

oltre 10 anni fa

Carica altro