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...
Summing digits
Given n, find the sum of the digits that make up 2^n.
Example:
Input n = 7
Output b = 11
since 2^7 = 128, and 1 + ...
8年以上 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
8年以上 前
解決済み
Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...
8年以上 前
解決済み
Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...
8年以上 前
解決済み
Remove the vowels
Remove all the vowels in the given phrase.
Example:
Input s1 = 'Jack and Jill went up the hill'
Output s2 is 'Jck nd Jll wn...
8年以上 前
解決済み
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]
8年以上 前
解決済み
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...
8年以上 前
解決済み
Derivative of polynomial
Compute the derivative of a given polynomial. The input is an <http://www.mathworks.com/help/matlab/math/representing-polynomial...
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];
8年以上 前
解決済み
What number has this problem?
This problem is added because it is problem number *???* in the "Community" problems section.
<http://www.mathworks.de/matlab...
8年以上 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.