Gelöst


Given a matrix, return the last eigen value
Given a matrix, return the first eigen value For example: x = magic(5) 17 24 1 8 15 23 5 7 14 ...

etwa ein Monat vor

Gelöst


Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||. Hint: It is as simple as "ABC".

etwa ein Monat vor

Gelöst


Find the average of a random sequance
Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

etwa ein Monat vor

Gelöst


How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1. Examples: Input...

etwa ein Monat vor

Gelöst


Generate a string like abbcccddddeeeee
This is the string version of Problem 1035. <http://www.mathworks.com/matlabcentral/cody/problems/1035-generate-a-vector-like-1-...

etwa ein Monat vor

Gelöst


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)* ...

etwa ein Monat vor

Gelöst


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

etwa ein Monat vor

Gelöst


Remove the polynomials that have positive real elements of their roots.
The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the roots of the p...

etwa ein Monat vor

Gelöst


Extract leading non-zero digit
<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

etwa ein Monat vor

Gelöst


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

etwa ein Monat vor

Gelöst


generate the matrix
given 3 inputs e.g [2,3,4] -- generate a matrix like below -- [2 2 0 0 0 0 0 0 0; 2 2 0 0 0 0 0 0 0; 0 0 3 3 3 0 0 0 0; 0 0...

etwa ein Monat vor

Gelöst


King's Cage
Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination. ...

etwa ein Monat vor

Gelöst


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

etwa ein Monat vor

Gelöst


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

etwa ein Monat vor

Gelöst


Encode Roman Numerals
Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

etwa ein Monat vor

Gelöst


Clock Hand Angle 1
Given a time in HH:MM:SS, find the smallest angle (in degrees) between the hour and minute hand

etwa ein Monat vor

Gelöst


Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

etwa ein Monat vor

Gelöst


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If p is the perimeter of a right angle triangle with integral length sides, { a, b, c }, there are exactly three solutions for p...

etwa ein Monat vor

Gelöst


Divisible by n, prime divisors (including powers)
For this problem, you will be provided an array of numbers (not necessarily in order). Return the array of numbers with only pri...

etwa ein Monat vor

Gelöst


Combined Ages 1 - Symmetric, n = 3
You have probably seen the common riddle wherein combined ages are provided and you must determine the individual ages. For exam...

etwa ein Monat vor

Gelöst


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

etwa ein Monat vor

Gelöst


find whether it is prime or not
For a given number find if its prime

etwa ein Monat vor

Gelöst


Triple function composition
Given three functions f,g and h, create the composed function y=f(g(h)). Example f = @(x) x+1 g = @(x) x/2 h = @(x) ...

etwa ein Monat vor

Gelöst


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...

etwa ein Monat vor

Gelöst


Replace odd number in given matrix by zero
Replace the odd numbers in a given matrix with zero. Example A = [ 17 24 1 8 15 23 5 7 ...

etwa ein Monat vor

Gelöst


Generate vector according to sign of vector
Generate vector according to sign of vector Example: If A=[-2 0 5] then output must be[-1 0 1] meaning that for negative n...

etwa ein Monat vor

Gelöst


Change the first and last diagonal element of the identity matrix to zero
Starting with the identity matrix, change first and last diagonal element to zero. Example If n=5 A = 0 0 ...

etwa ein Monat vor

Gelöst


Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

etwa ein Monat vor

Gelöst


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

etwa ein Monat vor

Gelöst


Upper triangular matrix
Create a function to retrieve the upper triangular matrix of a matrix (without using tril). The matrix will always be square. ...

etwa ein Monat vor

Mehr laden