Alessandro Ugolini
自 2019 起处于活动状态
Università degli Studi di Parma
Content Feed
已解决
The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...
2 years 前
已解决
Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
3 years 前
已解决
Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...
3 years 前
已解决
Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...
3 years 前
已解决
multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...
3 years 前
已解决
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
3 years 前
已解决
Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...
3 years 前
已解决
Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...
3 years 前
已解决
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
3 years 前
已解决
surface of a spherical planet
you just discovered its circumference, that is the input.
3 years 前
已解决
Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12
3 years 前
已解决
The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
3 years 前
已解决
Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...
3 years 前
已解决
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 + ...
3 years 前
已解决
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...
3 years 前
已解决
Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...
3 years 前
已解决
Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
3 years 前
已解决
Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...
3 years 前
已解决
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...
3 years 前
已解决
Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...
3 years 前
已解决
Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...
3 years 前
已解决
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...
3 years 前
已解决
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 ...
3 years 前