Solved

Back to basics - mean of corner elements of a matrix

Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

6 days ago

Solved

Duplicate a character

Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

6 days ago

Solved

Replace May with April

For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

9 days ago

Solved

Create a Matrix of Zeros

Given an input x, create a square matrix y of zeros with x rows and x columns.

9 days ago

Solved

Finding an element in a vector

x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

11 days ago

Solved

vector to string

Determine what the ASCII characters spell out. Example: input = [ 72 73 71 72] output = 'HIGH'

11 days ago

Solved

Find and replaces spaces from a input string with *

For a given input string str, find how many spaces are there in the string and replace those spaces with * e.g. str = 'this is ...

11 days ago

Solved

Reverse a string

Reverse the given string. Example input = 'reverse' output = 'esrever'

11 days ago

Solved

Find the maximum two numbers of every column of a matrix

Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

11 days ago

Solved

Basic commands - rounding

make a function which will round to integer, which is nearer to zero. Example x=[-2.5 2]; y=[-2 2];

11 days ago

Solved

Count number of words in string

Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

11 days ago

Solved

Sum the squares of numbers from 1 to n

For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

11 days ago

Solved

Area of a Square

Given the length x of the side of a regular square, find the area of the square, A.

11 days ago

Solved

metre to feet converter

The idea is to make a converter, which exchange meters to feets. We use a factor of 1m = 3.281*1f. so 3m are equals to 9.843 m...

11 days ago

Solved

Is it column vector?

Is it column vector? Check vector for column vector without using iscolumn function.

11 days ago

Solved

Find the dimensions of a matrix

Just find the number of columns of the given matrix. Example x = [1 2 3 4 5 6] y = 2

11 days ago

Solved

Determine the length of a string of characters

Determine the length of a string of characters

12 days ago

Solved

If-then-else

Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

12 days ago

Solved

03 - Matrix Variables 4

Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

12 days ago

Solved

Multiply a column by a row

* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

12 days ago

Solved

Find the next prime number

Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

12 days ago

Solved

Remove white space from the string

Remove the white spaces (trailing and leading) from the input variable

12 days ago

Solved

Sum of diagonals elements of a matrix

Given a matrix, return the sum of all the elements across the diagonals. E.g. A = [1 2 3; 4 5 6; 7 8 9;...

12 days ago

Solved

Divide by 4

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

12 days ago