A shooting competition
In a shooting competition, the target is a square of side L containing a circle of radius R<=L/2. A player scores one point if h...
9年以上 前
解決済み
Find my daddy short leg
Given the ratio of the two legs,and the hypotenuse, find the value of the shorter leg
Add the even numbers
Add only the even numbers of x
example:
x = [1 2 3 4 5]
the positive numbers are: 2 4, so their sum is 6
9年以上 前
解決済み
Basic commands - rounding
make a function which will round to integer, which is nearer to zero.
Example
x=[-2.5 2];
y=[-2 2];
9年以上 前
解決済み
Basic commands - amount of inputs
Make a function, which will return amount of given inputs
Example:
amountinput(1,2,4,3,10) -> 5 , because we gave functio...
Rotate Matrix Depending on the input
Rotate matrix (CounterClockwise) via 90, 180 or -90 depending on the input
Ex. a = [1 2 3;
4 5 6;
7 8 9]
b = 90;
...
9年以上 前
解決済み
BASICS - sum part of vector
Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum.
Examp...
Find max prime number
Given integer number n. Find the max prime number (mpn) that smaller than or equal to n.
Example:
n = 10
--> mpn = 7
9年以上 前
解決済み
All odd - all even
All odd numbers in x are added, while all even numers are subtracted from this.
example:
x = [1 2 3 4 5];
y = +(1+3+5)-...
9年以上 前
解決済み
Odd times even numbers in a matrix
First count the number of odd numbers in x, then the number of even. Return their product.
example:
x = [1 2]
One odd ...