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]
1年以上 前
解決済み
Beginner's Problem - Squaring
Try out this test problem first.
Given the variable x as your input, square it by two and put the result in y.
Examples:
...
Box!
Given a box, find the volume of the cube. With each side = a.
1年以上 前
解決済み
free points
function y = your_fcn_name(x)
y = x(1)+x(2);
end
1年以上 前
解決済み
Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man?
Give the name of that man, who, by popular believe, can ...
1年以上 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.
1年以上 前
解決済み
Y=X
Given an input variable x, output a variable y that is equal in value to x.
Example:
Input x = 1
Output y is 1
Inp...
1年以上 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
Unit conversion
Convert x degree Celsius to y degree Fahrenheit.
1年以上 前
解決済み
Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...
1年以上 前
解決済み
Convert yards to feet
The goal of this script is to convert a value given in yards to feet.
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
1年以上 前
解決済み
Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...
1年以上 前
解決済み
Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...
1年以上 前
解決済み
MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
1年以上 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
1年以上 前
解決済み
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...
1年以上 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
1年以上 前
解決済み
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...
1年以上 前
解決済み
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...
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...
1年以上 前
解決済み
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...
1年以上 前
解決済み
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:...
1年以上 前
解決済み
Linear Motion 4
A robot accelerates at a rate of A ft/s2. Assuming the robot starts from rest how much time is required to reach an object loca...
1年以上 前
解決済み
Linear Motion 2
During testing in the desert, a remotely operated vehicle travels D kilometers over rough terrain. The testing takes place over...