Odd times 3
Given a input matrix x, multiply all odd values by 3. Even values remain the same.
example:
x = [1 2 3 4 5;...
6 7...
約9年 前
解決済み
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年 前
解決済み
Circular Shift Me
Given a vector v=[1 3 6 9 11], circular shift them while iterating
m=[1 3 6 9 11; 11 1 3 6 9; 9 11 1 3 6; 6 9 11 1 3; 3 6 9 1...
Create cell array of strings
Convert the input to a cell array, but only if necessary.
If the input is a string, return a 1-by-1 cell array containing the...
Can I make a right triangle ?
Input(a) - is vector with any amount of values. Interpreted as legths of sides.
Output(b):
* Is true if there are any 3 va...
Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid
Example
Input:
x = [0 0 1]; % x-coordinate
y = [0 1 0]; % y-coordinat...
約9年 前
解決済み
Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...
Polynomial Evaluation
Create a routine that takes a list of coefficients of a polynomial in order of increasing powers of x; together with a value of ...
Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....
約9年 前
解決済み
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...