Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
oltre un anno fa
Risolto
Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.
oltre un anno fa
Risolto
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displayed ...
oltre un anno 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 Celsi...
oltre un anno 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...
oltre un anno 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:...
oltre un anno fa
Risolto
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
oltre un anno fa
Risolto
Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example:
[q,r] = swap(5,10)
returns q = ...
oltre un anno fa
Risolto
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B.
So if
A = [1 2 3;
4 5 6];
...
oltre un anno fa
Risolto
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...