Risolto


modulus of a number
find the modulus of a given number

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

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

quasi 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

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

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

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

quasi 10 anni fa

Risolto


Unit conversion
Convert x degree Celsius to y degree Fahrenheit.

quasi 10 anni fa

Risolto


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

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

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

quasi 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

quasi 10 anni fa

Risolto


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

quasi 10 anni fa

Risolto


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

quasi 10 anni fa

Risolto


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

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

quasi 10 anni fa

Risolto


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

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

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

quasi 10 anni fa

Risolto


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

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

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

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

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

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

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

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

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

quasi 10 anni fa

Risolto


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

quasi 10 anni fa

Carica altro