Gelöst


find "greatest common divisor" of two integer value
A function to find Greatest Common Divisor of two integer input E.G. x=-18 y=96 output should be +6 x=-18; y=96; >>your...

etwa ein Jahr vor

Gelöst


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.

etwa ein Jahr vor

Gelöst


Find out missing number from a vector of 9 elements
You are given a vector of size 9, x = [x1 x2 x3 x4 x5 x6 x7 x8 x9] Elements of x may be randomly selected without repeati...

etwa ein Jahr vor

Gelöst


Indirect Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

etwa ein Jahr vor

Gelöst


What's Your BMI?
Find the body mass index. For reference, please refer to Wikipedia here: <http://en.wikipedia.org/wiki/Body_mass_index body ...

etwa ein Jahr vor

Gelöst


Find Logic 20

etwa ein Jahr vor

Gelöst


select the primes of a vector
Find the prime numbers in a vector

etwa ein Jahr vor

Gelöst


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

etwa ein Jahr vor

Gelöst


Close MATLAB with keyboard
Close MATLAB with keyboard without using mouse

etwa ein Jahr vor

Gelöst


Back to Basics - Find no. of elements in a matrix?
Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

etwa ein Jahr vor

Gelöst


Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Implement a bubble sort technique and output the number of swaps required
A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

etwa ein Jahr vor

Gelöst


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

etwa ein Jahr vor

Gelöst


Van Eck's Sequence's nth member
Return the Van Eck's Sequence's nth member. For detailed info : <http://oeis.org/A181391 OEIS link> and <https://www.theguard...

etwa ein Jahr vor

Gelöst


Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...

etwa ein Jahr vor

Gelöst


Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

etwa ein Jahr vor

Gelöst


Transpose of matrix
Transpose of matrix as per test cases

etwa ein Jahr vor

Gelöst


Negative Infinity
Round the given array a towards negative infinity.

etwa ein Jahr vor

Gelöst


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

etwa ein Jahr vor

Gelöst


Vector Multiplication
Vector Multiplication of three matrix as shown in test cases.

etwa ein Jahr vor

Gelöst


Is it an Armstrong number?
An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Fo...

etwa ein Jahr vor

Gelöst


Back to basics 25 - Valid variable names
Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

etwa ein Jahr vor

Gelöst


Shuffle
Shuffle a vector by breaking it up to segments of |n| elements, and rearranging them in a reversed order. For example, the ve...

etwa ein Jahr vor

Gelöst


Triangle of numbers
Create a matrix with the integers from 1 to |n| arranged in a triangular shape. Every row |i| of the matrix contains |i| inte...

etwa ein Jahr vor

Gelöst


Vertical matrix sort
Given a matrix x with n rows and m columns, return a matrix y with 2n rows and m columns, such that every column in x is sorted ...

etwa ein Jahr vor

Gelöst


Narcissistic number ?
Inspired by Problem 2056 created by Ted. In recreational number theory, a narcissistic number is a number that is the sum of ...

etwa ein Jahr vor

Gelöst


Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?; x = [1 : 0.5 : 6]; y ...

etwa ein Jahr vor

Mehr laden