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
5日 前
解決済み
MATLAB Basic: rounding III
Do rounding towards minus infinity.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 8
5日 前
解決済み
MATLAB Basic: rounding IV
Do rounding towards plus infinity.
Example: -8.8, answer -8
+8.1 answer 9
+8.50 answer 9
5日 前
解決済み
MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
5日 前
解決済み
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...
5日 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
5日 前
解決済み
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...
5日 前
解決済み
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 ...
6日 前
解決済み
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...
6日 前
解決済み
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...
6日 前
解決済み
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...
6日 前
解決済み
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...
6日 前
解決済み
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 = ...
6日 前
解決済み
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.
6日 前
解決済み
NOT
If a not equal to zero, b = true, else, b = false.
6日 前
解決済み
OR
If a greater than zero or c less than 10, b = true, else, b = false.