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...
Basic commands - rounding
make a function which will round to integer, which is nearer to zero.
Example
x=[-2.5 2];
y=[-2 2];
4年以上 前
解決済み
angle in regular polygon
Make a function which returns measure of interior angle in x-side regular polygon. x is as input.
Please pay attention, that 1 ...
4年以上 前
解決済み
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".
4年以上 前
解決済み
Free passes for everyone!
_Simply return the name of the coolest numerical computation software ever_
*Extra reward* (get a _freepass_):
Once a mont...
4年以上 前
解決済み
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年以上 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
4年以上 前
解決済み
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
4年以上 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
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...
4年以上 前
解決済み
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 y...
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...
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...
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...
5年弱 前
解決済み
Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x
e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]
5年弱 前
解決済み
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1.
Examp...
5年弱 前
解決済み
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:...