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

11 maanden ago

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

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

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

11 maanden ago

Solved

Swap the first and last columns

Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

11 maanden 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 = ...

11 maanden ago

Solved

Create an n-by-n null matrix and fill with ones certain positions

The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

12 maanden ago

Solved

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

12 maanden ago

Solved

Elapsed Time

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

12 maanden ago

Solved

Matlab Basics II - Count rows in a matrix

Write a function that returns that number of rows in a vector or matrix x example: x = [1; 2; 3] output = 3

12 maanden ago

Solved

Matlab Basics - Absolute Value

Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

12 maanden ago

Solved

Matlab Basics II - Extract last 3 elements of a vector

Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives t...

12 maanden ago

Solved

Create a Multiplication table matrix...

Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

12 maanden ago

Solved

find radius of cone

if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

12 maanden ago

Solved

Solve the set of simultaneous linear equations

Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

12 maanden ago

Solved

Calculate distance travelled when given radius and rotations

When given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14

12 maanden ago

Solved

Matlab Basics II - squares

Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

12 maanden 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]

12 maanden ago

Solved

Sum the numbers on the main diagonal

Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

12 maanden ago

Solved

Determine if input is odd

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

12 maanden ago

Solved

Matlab Basics II - Minimum

Write a function that returns the minimum of each ROW of a matrix x example: x = [1 2 3; 4 5 6]; output [1;4];

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

12 maanden ago

Solved

Given area find sides

In a right angle triangle given area 'A' one arm=x, another arm=2x then find the value of x. For example, area A=400 then ...

12 maanden ago

Solved

Compare two input matrices

Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

12 maanden ago

Solved

distance to a straight line (2D) given any 2 distinct points on this straight line

Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answ...

12 maanden ago

Solved

Vector parallel to plane?

Given the coefficients of the equation which defines a plane as follows: ax+by+cz=d, return a boolean indicating whether the 2n...

12 maanden ago

Solved

Finding Perfect Squares

Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false. Example...

12 maanden ago