Top 10% contributor
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN.
1 year ago
Remove the nth column from input matrix A and return the resulting matrix in output B.
A = [1 2 3; 4 5 6];
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...
3 years ago
Given a and b, return the sum a+b in c.
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...
Regardless of input, output the string 'yes'.
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
Given two lists of numbers, determine the weighted average.
[1 2 3] and [10 15 20]
should result in
Check if sorted.
Input x = [1 2 0]
Output y is 0
Given the input n, return true if n is odd or false if n is even.
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Join the conversation