Solved

Whether the input is vector?

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

1 year ago

Solved

Get the length of a given vector

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

1 year ago

Solved

Matlab Basics - Create a row vector

Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

1 year ago

Solved

Duplicate a character

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

1 year ago

Solved

04 - Scalar Equations 1

Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

1 year ago

Solved

Reverse the elements of an array

Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

1 year ago

Solved

Insert zeros into vector

Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

1 year ago

Solved

Determine if input is odd

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

1 year ago

Solved

Specific Element Count

Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

1 year ago

Solved

Write a code that will follow the equation y = x * (x + x) * x.

If x = 5, y = 5 * (5+5) * 5 = 250

1 year ago

Solved

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

1 year ago

Solved

BASICS - sum part of vector

Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum. Examp...

1 year ago

Solved

Back to Basics - Find no. of elements in a matrix?

Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

1 year ago

Solved

Add two numbers

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

1 year ago

Solved

Inscribed Pentagon?

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

1 year ago

Solved

Circle/Pentagon Overlap

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

1 year ago

Solved

Spot the First Occurrence of 5

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

1 year ago

Solved

Octoberfest festival

A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

1 year ago

Solved

Find the nearest prime number

Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

1 year ago

Solved

Missing five

Convert decimal numbers to a base-9 notation missing the digit *5* <<http://www.alfnie.com/software/missing5.jpg>> Too man...

1 year ago

Solved

Breaking Out of the Matrix

Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

1 year ago

Solved

Energy of a photon

*⚛ ☢ ⚛ ☢ ⚛ ☢ ⚛* Given the frequency F of a photon in giga hertz. Find energy E of this...

1 year ago

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

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

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

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

1 year ago

Solved

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

1 year ago