Number of Horns on a unicorn!
Calculate the number of horns on a *unicorn*!
And I'm talking about a unicorn with not more than one horn on it!
9 years 前
已解决
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
9 years 前
已解决
Add 7
Given an input variable x, output a variable y that is 7 greater than x.
Example:
Input x = 1
Output y is 8
Input ...
9 years 前
已解决
Try 1.5.4: Celsius to Fahrenheit
Write a program to convert an input given in Celsius to Fahrenheit.
Examples:
Input celsiusValue = 100
Output fahrValu...
9 years 前
已解决
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];
9 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".
9 years 前
已解决
Roll the Dice!
*Description*
Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice.
*Example*
[x1,x2] =...
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x.
For instance if x=2 then y must be 1+2+3+4=10.
9 years 前
已解决
Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.
9 years 前
已解决
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
9 years 前
已解决
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Non-scor...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
9 years 前
已解决
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...