Box!
Given a box, find the volume of the cube. With each side = a.
約6年 前
解決済み
Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector.
For example:
x = [6 10 5 8 9 NaN 23 9 7 3 21 ...
約6年 前
解決済み
Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle.
Example:
[3 4 5] -> 2.5
metre to feet converter
The idea is to make a converter, which exchange meters to feets.
We use a factor of 1m = 3.281*1f.
so 3m are equals to 9.843 m...
Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row
約6年 前
解決済み
Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1.
example:
x=4
ans=
[0 1 1 1
1 0 0 0
...
約6年 前
解決済み
Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4)
Example:
x=5
ans=
[1 1 1 1 0
1 0 0 0 1
...
約6年 前
解決済み
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
約6年 前
解決済み
Is it column vector?
Is it column vector?
Check vector for column vector without using iscolumn function.