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...
Can we make a triangle?
Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...
2年以上 前
解決済み
Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.
2年以上 前
解決済み
Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...
2年以上 前
解決済み
Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...
2年以上 前
解決済み
Weighted average
Given two lists of numbers, determine the weighted average as follows
Example
[1 2 3] and [10 15 20]
should result in
33.3...
Create an arrow matrix
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row.
...
3年弱 前
解決済み
Generate this matrix
Generate the following matrix.
n = 2;
out = [-4 -3 -2 -1 0
-3 -2 -1 0 1
-...
3年弱 前
解決済み
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
3年弱 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
3年弱 前
解決済み
Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....
3年弱 前
解決済み
Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column:
in:
...
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
3年弱 前
解決済み
Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'.
Examples
x = [ 1...
3年弱 前
解決済み
convert between ascii and characters
I have seen multiple problems like this but none of them have a robust test suite associated with them.
The first input C is ...