Return the sequence element II
Given positive integers x and n, return a positive integer, y, which is the nth term in the <https://en.wikipedia.org/wiki/Juggl...
Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones.
* Find 1 0 1 and replace it with 1 1 1
* Find 0 1 0 and replace it w...
約4年 前
解決済み
Area of a pentagon
Given the side of a regular pentagon and its apothem return the area of pentagon.
Remember the area of pentagon is calculate ...
"mirror" matrix
Create n x 2n "mirror" matrix of this type:
Examples
For n = 2
m = [ 1 2 2 1
1 2 2 1 ]
For n = 3
m = ...
約4年 前
解決済み
NaN (欠損値) が含まれている行を削除しよう
行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。
例:
A = [ 1 5 8
-3 NaN 14
...
約4年 前
解決済み
Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1.
Examp...
約4年 前
解決済み
'Determine if array of numbers is odd'
Return true if the input single number is odd. If the input is a vector, it will return a vector or array of logical values indi...
約4年 前
解決済み
Odd times even numbers in a matrix
First count the number of odd numbers in x, then the number of even. Return their product.
example:
x = [1 2]
One odd ...
約4年 前
解決済み
Maximum of ND-array
Find the maximum element of a N dimensional array.
Example:
A=[1 2 4 ; -20 4 10];
The maximum is 10.
約4年 前
解決済み
Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...