Gelöst


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

fast 12 Jahre vor

Gelöst


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

fast 12 Jahre vor

Gelöst


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

fast 12 Jahre vor

Gelöst


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

fast 12 Jahre vor

Gelöst


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

fast 12 Jahre vor

Gelöst


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

fast 12 Jahre vor

Gelöst


Back to basics 16 - byte order
Covering some basic topics I haven't seen elsewhere on Cody. Switch the byte order of the input (i.e. if little-endian -> big...

fast 12 Jahre vor

Gelöst


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

fast 12 Jahre vor

Gelöst


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

fast 12 Jahre vor

Gelöst


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

fast 12 Jahre vor

Gelöst


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

fast 12 Jahre vor

Gelöst


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

fast 12 Jahre vor

Gelöst


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

fast 12 Jahre vor

Gelöst


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

fast 12 Jahre vor

Gelöst


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

fast 12 Jahre vor

Gelöst


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

fast 12 Jahre vor

Gelöst


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

fast 12 Jahre vor

Gelöst


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

fast 12 Jahre 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...

fast 12 Jahre vor

Gelöst


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

fast 12 Jahre vor

Gelöst


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

fast 12 Jahre vor

Gelöst


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

fast 12 Jahre vor

Gelöst


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

fast 12 Jahre vor

Gelöst


Making change
Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

fast 12 Jahre vor

Mehr laden