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.
8 years ago
Solved
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
8 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...
8 years ago
Solved
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
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...
8 years ago
Solved
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:...
8 years ago
Solved
Squaring Matrix
Square the following matrix using matlab
%
A = 1 2 3 4
5 6 7 8
So new matrix should display...
8 years ago
Solved
Sum of the Multiplication of Vectors
Given the vectors x and y as input, multiply the vectors and return the summation of its elements.
Example:
x = [1 2 ...
8 years ago
Solved
Times 3 problem
When you enter the number, it should return the number multiplied by 3
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...