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
...
8年以上 前
解決済み
Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'.
Examples
x = [ 1...
Replace values under a limit
For a vector x and number n, the goal is to find every element of x inferior to n and replace it by n.
Example
x= [ 1 2 3...
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 + ...
Basic commands - rounding
make a function which will round to integer, which is nearer to zero.
Example
x=[-2.5 2];
y=[-2 2];
8年以上 前
解決済み
Cumulative product of a vector
Cumulative product of a vector
example
x=[1 2 5 10], then answer must be [ 1 2 10 100]
*If you like this prob...
8年以上 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
8年以上 前
解決済み
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.