The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
4 days 前
已解决
MATLAB Basic: rounding III
Do rounding towards minus infinity.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 8
4 days 前
已解决
MATLAB Basic: rounding IV
Do rounding towards plus infinity.
Example: -8.8, answer -8
+8.1 answer 9
+8.50 answer 9
4 days 前
已解决
MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
4 days 前
已解决
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...
4 days 前
已解决
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
4 days 前
已解决
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...
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...
4 days 前
已解决
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...
High Five!
Write a function that takes a number x and returns y = 'High Five' if x is not equal to five. Return y = 'Denied' if the number ...
4 days 前
已解决
A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...
4 days 前
已解决
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...
4 days 前
已解决
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...
4 days 前
已解决
Problem Set 2
Make a calculator by the four main operators (op):
+
-
*
/
And the two numbers (n1, n2).
Don't forget to check to divisio...
4 days 前
已解决
Problem Set 1
You will get the vector "v", you should put it's length in a variable called "lngth", then...
If it's length from 1 to 5, sz = ...
4 days 前
已解决
Switch-Case-Otherwise
You should make random numbers to 10, by 3 rows and 3 columns.
Cases from 1 to 3, b = true.
Otherwise, b = false.
5 days 前
已解决
NOT
If a not equal to zero, b = true, else, b = false.
5 days 前
已解决
OR
If a greater than zero or c less than 10, b = true, else, b = false.