Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
3年以上 前
解決済み
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...
3年以上 前
解決済み
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...
3年以上 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
3年以上 前
解決済み
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...
3年以上 前
解決済み
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...
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...
3年以上 前
解決済み
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Non-scor...
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...
Array Concatenation (2)
Given two matrices, a and b, concatenate the two matrices vertically, i.e., the number of rows of the result should be equal to ...
Maximum of ND-array
Find the maximum element of a N dimensional array.
Example:
A=[1 2 4 ; -20 4 10];
The maximum is 10.
3年以上 前
解決済み
Find max
Find the maximum value of a given vector or matrix.
3年以上 前
解決済み
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...