Calculate some equation
Using given inputs x and z, make two outputs that are
y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2
y2 = x^z - z^x + (x/z)^2 - (z/x...
9 years ago
Solved
Convert yards to feet
The goal of this script is to convert a value given in yards to feet.
9 years ago
Solved
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:
...
9 years ago
Solved
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
9 years ago
Solved
Roll the Dice!
*Description*
Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice.
*Example*
[x1,x2] =...
9 years ago
Solved
only input
Return the output without writing any code into the function.
9 years ago
Solved
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 ago
Solved
Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...
9 years ago
Solved
Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.
9 years ago
Solved
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...
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Non-scor...
9 years ago
Solved
Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...
9 years ago
Solved
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...