Subtract integers and add doubles
Create a function that subtracts a from b if a and b are integers and adds them if they are floats.
5年弱 前
解決済み
calculate PI without using pi function
There are many methods to get the pi(Ratio of circumference to diameter).
You should get pi without using the pi function in M...
Times 5
Try out this test problem first.
Given the variable x as your input, multiply it by five and put the result in y.
Examples...
5年弱 前
解決済み
Calculate solution of given polynomial
For example,
y=function([3 -2 -4])
In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.
y=[1.5...
Mo money, mo math 1! (★★★)
(adapted from Prob 9 Cody team)
You have a vector where the elements represent the number of $20 bills, $10 bills, $5 bills, ...
5年弱 前
解決済み
Volume of Spherical Shell
In three-dimensional space, a spherical shell can be constructed from two concentric spheres. Determine the volume of a spheric...
Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...
5年弱 前
解決済み
Replace Nan!
Replace Nan in the given vector(v) with 9999.
5年弱 前
解決済み
Increment up an input vector
Increment up an input vector by adding the indices to the vector values. For example, if an input vector is [3, 2, 6, 1, 6], the...
5年弱 前
解決済み
Sum of elements of a vector (★★★)
Given any vector x = [x1, x2, x3, ... xn], compute the sum of its elements.
Thus, if x = [ 1 3 -2 5 ], then the sum of its el...
Find the Area of a Polygon
Consider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the...