Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...
9 mesi fa
Risolto
Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order).
E.g: nextP('ABCD') = ABDC
If you...
9 mesi fa
Risolto
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<https://i.imgur.com/jlZDHhq.png>>
Image courtesy of <http://up...
9 mesi fa
Risolto
Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...
9 mesi fa
Risolto
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
9 mesi fa
Risolto
Create a vector
Create a vector from 0 to n by intervals of 2.
Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle.
<<https://i.imgu...
9 mesi fa
Risolto
Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...
9 mesi fa
Risolto
Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...
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 mesi fa
Risolto
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:...