Gelöst


Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not count...

3 Tage vor

Gelöst


Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

3 Tage vor

Gelöst


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

4 Tage vor

Gelöst


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

4 Tage vor

Gelöst


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

4 Tage vor

Gelöst


Create a vector
Create a vector from 0 to n by intervals of 2.

4 Tage vor

Gelöst


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

4 Tage vor

Gelöst


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

4 Tage vor

Gelöst


Find max
Find the maximum value of a given vector or matrix.

4 Tage vor

Gelöst


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

4 Tage vor

Gelöst


Inner product of two vectors
Find the inner product of two vectors.

4 Tage vor

Gelöst


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

4 Tage vor

Gelöst


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

4 Tage vor

Gelöst


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

4 Tage vor

Gelöst


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

4 Tage vor

Gelöst


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

4 Tage vor

Gelöst


Acid and water
⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ Assume that there is a 100 liter tank. It is initially fi...

4 Tage vor

Gelöst


Parse me a Lisp
*Description* In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is ...

4 Tage vor

Gelöst


MATLAB 101: Tribonacci Sequence
Each number in the Tribonacci series is the sum of the three preceding ones. Sequence: 0, 0, 1, 1, 2, 4, 7, 13, 24, 44, ... Writ...

4 Tage vor

Gelöst


MATLAB 101: Reverse a Vector
Write a MATLAB function that takes a 1D vector (either a row or a column vector) and returns the vector with its elements in exa...

4 Tage vor

Gelöst


MATLAB 101: Hypotenuse Calculator
Write a MATLAB function that accepts the base and height of a right-angled triangle (or arrays of bases and heights) and returns...

4 Tage vor

Gelöst


Merge structs on fields
Merge a bunch of structs into one, containing the field names and corresponding values of all input structs. For duplicate field...

4 Tage vor

Gelöst


Undocumented MATLAB tricks No. 2 - Tell the parfor index
Your function is called in multiple for-loops, and the loop indices are given to your function. One of these indices are from a ...

4 Tage vor

Gelöst


Calculate the sum of two numbers x and y v2
This is inspired by the broken test suite of problem 59089. As in that problem, your task is simple: calculate the sum of two nu...

4 Tage vor

Gelöst


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

4 Tage vor

Gelöst


Add two numbers
Given a and b, return the sum a+b in c.

4 Tage vor

Gelöst


Pair Primes
Let's define pair primes as follow; For 2 digits numbers: 11 and 17 are pair primes because both of them are 2 digits prime num...

6 Tage vor

Gelöst


Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

10 Tage vor

Gelöst


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

10 Tage vor

Gelöst


Show me the shape of your array
Write a function that determines the shape of the input array x: Return 'square' if x has the same number of rows and colum...

10 Tage vor

Mehr laden