Risolto


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

circa 8 anni fa

Risolto


Signed Magnitude
For a given input vector, return the value that is furthest from zero. For example, if x = [1 2 -12] return -12.

circa 8 anni fa

Risolto


Volume of a sphere given its surface area
You just measured its surface area, that is the input.

circa 8 anni fa

Risolto


Acid and water
⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ Assume that there is a 100 liter tank. It is initially fi...

circa 8 anni fa

Risolto


5th Time's a Charm
Write a function that will return the input value. However, your function must fail the first four times, only functioning prope...

circa 8 anni fa

Risolto


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

oltre 8 anni fa

Risolto


Combine the first and last names
MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays o...

oltre 8 anni fa

Risolto


Sum the real and imaginary parts of a complex number
Sum the real and imaginary parts of a complex number. Example c = 1+2i has the solution 1 + 2 = 3

oltre 8 anni fa

Risolto


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

oltre 8 anni fa

Risolto


Find the square of the sum of the digits of a number
If a number (n) is provided as an input, find the square of the sum of the digits of the number. Example If n = 21, the an...

oltre 8 anni fa

Risolto


Change the first and last diagonal element of the identity matrix to zero
Starting with the identity matrix, change first and last diagonal element to zero. Example If n=5 A = 0 0 ...

oltre 8 anni fa

Risolto


Is this a valid Tic Tac Toe State?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

oltre 8 anni fa

Risolto


Finding an element in a vector
x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

oltre 8 anni fa

Risolto


wait for me
wait exactly x seconds please, need not be more than 2 seconds but must be accurate within say 50 milliseconds, your function mu...

oltre 8 anni fa

Risolto


UICBioE240 problem 1.1
Remove the middle row from a matrix, assuming # of rows is odd. So if A = [ 1 2 3; 4 5 6; 7 8 9] the...

oltre 8 anni fa

Risolto


Small Riddle
Mr. Smith has two children. If the older child is a boy, what are the odds that the other child is also a boy?

oltre 8 anni fa

Risolto


Largest Prime Number
Given a matrix X, find the largest prime number in X.

oltre 8 anni fa

Risolto


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

oltre 8 anni fa

Risolto


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

oltre 8 anni fa

Risolto


Rotate Matrix @180 degree
Rotate Matrix @180 degree Example A=[8 1 6; 3 5 7; 4 9 2], then answer would be [2 9 4;...

oltre 8 anni fa

Risolto


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

oltre 8 anni fa

Risolto


Find the sum of n squares
What is the sum of the squares of the first n integers?

oltre 8 anni fa

Risolto


metre to feet converter
The idea is to make a converter, which exchange meters to feets. We use a factor of 1m = 3.281*1f. so 3m are equals to 9.843 m...

oltre 8 anni fa

Risolto


Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

oltre 8 anni fa

Risolto


Test
Answer the question and the correct answer write in vector. Only one answer is correct. 1a Yes 1b No 1c No 1d No ...

oltre 8 anni fa

Risolto


Average Grade
Given a 1x5 vector presents the grades of a student on five tests. Calculate the average grade of that student.

oltre 8 anni fa

Risolto


Replace all zeros and NaNs in a matrix with the string 'error'
Given a numeric input matrix A, possibly containing some zero values and some NaNs, replace any occurrences of zero or NaN with ...

oltre 8 anni fa

Risolto


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

oltre 8 anni fa

Risolto


2048 Next Move
Given a board in the game 2048 (see the game here: <http://gabrielecirulli.github.io/2048/ 2048>) and a direction ('up','down','...

oltre 8 anni fa

Risolto


Write c^3 as sum of two squares a^2+b^2
write c^3 as sum of two squares a^2+b^2. a and b must be integer and greater than zero. For example 5^3 = 2^2 + 11^2 5...

oltre 8 anni fa

Carica altro