MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
約2ヶ月 前
解決済み
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...
約2ヶ月 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
約2ヶ月 前
解決済み
Find max
Find the maximum value of a given vector or matrix.
約2ヶ月 前
解決済み
Calculate Inner Product
Given two input matrices, x and y, check if their inner dimensions match.
If they match, create an output variable z which cont...
約2ヶ月 前
解決済み
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B.
So if
A = [1 2 3;
4 5 6];
...
約2ヶ月 前
解決済み
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.
約2ヶ月 前
解決済み
Check if number exists in vector
Return 1 if number a exists in vector b otherwise return 0.
a = 3;
b = [1,2,4];
Returns 0.
a = 3;
b = [1,2,3];
Returns 1.
約2ヶ月 前
解決済み
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
約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...
約2ヶ月 前
解決済み
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
約2ヶ月 前
解決済み
Maximum value in a matrix
Find the maximum value in the given matrix.
For example, if
A = [1 2 3; 4 7 8; 0 9 1];
then the answer is 9.
約2ヶ月 前
解決済み
Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...
約2ヶ月 前
解決済み
Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation,
* F(n) = F(n-1) + F(n-2)
* where F(1) = 1 and F(1)...
約2ヶ月 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input...
Find the Oldest Person in a Room
Given two input vectors:
* |name| - user last names
* |age| - corresponding age of the person
Return the name of the ol...
約2ヶ月 前
解決済み
Sum of series IX
What is the sum of the following sequence:
Σ 1/k! for k=1...n
for different n?