Unit Matrix
Given n, you should return an n-by-n unit matrix.
Example:
If input is n=2 then
A = [ 1 0
0 1 ]
If input ...
約5年 前
解決済み
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...
約5年 前
解決済み
Armstrong Number
Determine whether the given input n-digit number is Armstrong Number or not.
Return True if it is an Armstrong Number. An n-D...
約5年 前
解決済み
prime test 2
enter the only non prime,non composite number
約5年 前
解決済み
Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3.
M = [1 2 3;4 5 6;7 8 9];
ou...
約5年 前
解決済み
特定の値がベクトル内に含まれているかを確認するコードを書こう
ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。
例:
a = 3;
b = [1,2,4];
スカラ値 3 はベクトル b に含まれていない...
Number of Horns on a unicorn!
Calculate the number of horns on a *unicorn*!
And I'm talking about a unicorn with not more than one horn on it!
約5年 前
解決済み
Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n.
For example:
v=[1 2 3 4 5 6]
n=3
vNew =...
約5年 前
解決済み
Who invented zero?
We know the importance zero in computer science, mathematics... but who invented zero?
Clue:
He was the first in the line ...
約5年 前
解決済み
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
...
約5年 前
解決済み
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
約5年 前
解決済み
Initialize a Natural Number matrix.
Given length of matrix initialize a matrix consisting of natural numbers from 1 to n:
n = 10;
x = [ 1 2 3 4 5 6 7 8 9 10];
...
約5年 前
解決済み
Remove All elements less than 5
Given an input vector x, remove all elements of x less than 5 .
Example:
Input x = [ 1 2 5 7 3 ]
Output y is [ 5 7 ...
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...