Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter).
Example
[1 2 3
4 5 6
7 8 9]
Output = ...
5年弱 前
解決済み
Determine given vector is even or odd
Find the numbers of the input vector is odd or even then replace even with 1 and odd with 0
Example
x = [ 3 3 4 6 1]
...
Find vampire numbers
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a
number v that is the product of two numbers x and y such th...
5年弱 前
解決済み
Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James
A generalised Hamming number of type n, has no prime factor larger ...
5年弱 前
解決済み
Max of a Vector
Write a function to return the max of a vector
5年弱 前
解決済み
Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.
5年弱 前
解決済み
STOP that car!!!
The maximum allowed speed for this road is 100. Find the cars that didn't observe the speed limit
Arrest and fine them!!!
5年弱 前
解決済み
Count up then down
Create a function that produces counting up from 0 up to n then down to 0
n=2 --> 0 1 2 1 0
n=3 --> ...
Is My Wife Wrong?
Answer the question.
(see also <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right Problem 149: Is my ...
5年弱 前
解決済み
find radius of cone
if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R)
for example I=5,h=4 then the ans R=3;
5年弱 前
解決済み
Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...
5年弱 前
解決済み
Proper Factors
Generate the proper factors of input integer x and return them in ascending order. For more information on proper factors, refer...
5年弱 前
解決済み
Numbers with prime factors 2, 3 and 5.
Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...
5年弱 前
解決済み
ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format.
We have only input x. We have to create a matrix in the following pattern.
input n=5...
The Matrix Construction
Given two input ,first one is CN (Column Number), Second one is Dim
Can you produce such a matrix for example
CN=6; Dim=2
...
約5年 前
解決済み
Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...
約5年 前
解決済み
Permute diagonal and antidiagonal
Permute diagonal and antidiagonal
For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7]
WITHOUT diag function (and variable n...
約5年 前
解決済み
Create a block diagonal matrix
A block diagonal matrix is a square matrix that can be written as
A = [a 0 0 0
0 b 0 0
0 0 c 0
...
約5年 前
解決済み
expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...
約5年 前
解決済み
Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_.
Note: NaNs are equal and there may be n...