Solved

Vector creation

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

2 years ago

Solved

Times 3 problem

When you enter the number, it should return the number multiplied by 3

2 years ago

Solved

Divide by 4

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

2 years ago

Solved

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

2 years ago

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 years ago

Solved

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

2 years ago

Solved

Sorted highest to lowest?

Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

2 years ago

Solved

Dimensions of a rectangle

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

2 years ago

Solved

Add two numbers

Calculate the sum of two numbers. Example input = [2 3] output = 5

2 years ago

Solved

Tell me the slope

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

2 years ago

Solved

Whether the input is vector?

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

2 years ago

Solved

How to subtract?

*± ± ± ± ± ± ± ± ± ± ±* * Imagine you need to subtract one...

2 years ago

Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

2 years ago

Solved

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

2 years ago

Solved

Weighted average

Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

2 years ago

Solved

Most nonzero elements in row

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

2 years ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

2 years ago

Solved

Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

2 years ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

2 years ago

Solved

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

2 years ago

Solved

Column Removal

Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

2 years ago

Solved

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

2 years ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

2 years ago

Solved

Counting Money

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

2 years ago

Solved

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

2 years ago

Solved

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

2 years ago

Solved

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

2 years ago