Eye Squared
For a positive integer |n| create the identity matrix with |n| elements.
In case it is not possible to produce an identity ma...
約7年 前
解決済み
Vertical matrix sort
Given a matrix x with n rows and m columns, return a matrix y with 2n rows and m columns, such that every column in x is sorted ...
約7年 前
解決済み
Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...
約7年 前
解決済み
Is it column vector?
Is it column vector?
Check vector for column vector without using iscolumn function.
Tax Calculator
Calculate the tax for a given income.
10% tax is paid for any income up to $2,000.
20% tax is paid for additional income u...
約7年 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
約7年 前
解決済み
I Plead the Fifth
Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...
約7年 前
解決済み
Change matrix to vector
Vector is a matrix whose size is 1 x n or n x 1.
Change matrix to vector.
x =
4 3
5 1
...
Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector.
Every element s(i) cont...
約7年 前
解決済み
Find the largest number
Given a vector v with 4 elements, find the largest number x.
Example:
Input: v = [4 7 1 6];
Output: x = 7;
You mu...