Top 5% contributor
2 years ago
If you have two small strings, like 'a' and 'b', return them put together like 'ab'.
'a' and 'b' => 'ab'
For extra ...
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
There will always be at least one prime in the matrix.
Input in = [ 8 3
5 9 ]
Output out is 4...
Given n, find the sum of the digits that make up 2^n.
Input n = 7
Output b = 11
since 2^7 = 128, and 1 + ...
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
Regardless of input, output the string 'yes'.
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN.
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...
Remove the nth column from input matrix A and return the resulting matrix in output B.
A = [1 2 3; 4 5 6];
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
Given a and b, return the sum a+b in c.
Given the input n, return true if n is odd or false if n is even.
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
Find the sum of all the numbers of the input vector x.
Input x = [1 2 3 5]
Output y is 11
Input x ...
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
1 year ago
Join the conversation