Solved

Center of mass

Given a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid...

1 year ago

Solved

Find the Best Hotels

Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

1 year ago

Solved

Sort complex numbers into complex conjugate pairs

Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

1 year ago

Solved

Related Vectors

I have two vectors A & B. If the values in vector A is zero then the corresponding value in vector B should be zero. Example:...

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

Mode

Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

1 year ago

Solved

Change the sign of even index entries of the reversed vector

change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

1 year ago

Solved

Given n, create n random numbers such that their standard deviation is also n.

Given n, create n random numbers such that their standard deviation is also n.

1 year ago

Solved

Crunch that matrix!

You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

1 year ago

Solved

Pentagonal Numbers

Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

1 year ago

Solved

find nth even fibonacci number

1st even fibonacci number=2 ; 2nd even fibonacci number=8 ..

1 year ago

Solved

Permute diagonal and antidiagonal

Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

1 year ago

Solved

Determine the perimeter of a three-quarter circle

If a circle has a diameter of x as an input value, then show the value of the perimeter of the three-quarter circle in output va...

1 year ago

Solved

How unique?

Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

1 year ago

Solved

Create a vector whose elements depend on the previous element

The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

1 year ago

Solved

Unique values without using UNIQUE function

You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

1 year ago

Solved

Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)

For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

1 year ago

Solved

Create an index-powered vector

Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

1 year ago

Solved

Volume of Cylinder

Compute the Circumference of a Cylinder given it's radius and height.Here x is the radius and y is the height

1 year ago

Solved

Create a square matrix of zeros of even order

Create a square matrix of zeros of even order

1 year ago

Solved

calculate the tangent of angle in radians

Calculate the tangent of angle in degrees

1 year ago

Solved

Speed of car

Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

1 year ago

Solved

An Ohm's Law Calculator

*BACKGROUND / MOTIVATION:* Many important observations in math and science can be described by short, but powerful, equations...

1 year ago

Solved

Simple Matrix

Make the following matrix without typing it in one by one. [1 2 3; 2 4 6; 4 8 12] x=[1 2 3].

1 year ago

Solved

Problem for beginners

M is a nxm matrix. Swap the fist and the second last column with eachother. X=[1 2 3;4 5 6;7 8 9] Y=[2 1 3;5 4 6;8 7 9]

1 year ago

Solved

intersection of matrices

Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

1 year ago