Make a vector of prime numbers
Input(n) - length of vector with prime numbers
Output(v) - vector of prime numbers
Example:
* n=1; v=2
* n=3; v=[2 3 5...
Put Two 1D matrices into one 1D matrix
Example:
If
input a = [1 2 3 4 5];
input b = [10 9 8 7 6];
then output will be,
y_correct = [1 10 2 9 3 8 4 7 5...
13年弱 前
解決済み
Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
約13年 前
解決済み
MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string.
For example
A='harsa';
b='harish'; result '1'
...
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A;
Output: A=(Aij),where each entry Aij is either...