Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle.
<<http://upload...
10年弱 前
解決済み
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];
10年弱 前
解決済み
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...
10年弱 前
解決済み
Compute total cost
A soda costs 2 dollars. A taco costs 3 dollars. Write a statement that assigns totalCost with the total meal cost given the numb...
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...
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
10年弱 前
解決済み
Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the hourly wage times 40 and times 50, because annualSalary = hour...
10年弱 前
解決済み
Assigning a sum
* Write a statement that assigns numCoins with numNickels + numDimes.
10年弱 前
解決済み
Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise
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 ...
10年弱 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
10年弱 前
解決済み
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...
10年弱 前
解決済み
Area of a Square
Inside a square is a circle with radius r.
What is the area of the square?
10年弱 前
解決済み
only input
Return the output without writing any code into the function.
10年弱 前
解決済み
Circle area using pi
Write a statement that assigns circleArea with the circle's area given circleRadius. Use the built-in mathematical constant pi. ...