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

nästan 3 år 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...

nästan 3 år 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 - ...

nästan 3 år 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:...

nästan 3 år ago

Solved

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

nästan 3 år 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...

nästan 3 år 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...

nästan 3 år 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.

nästan 3 år 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 ...

nästan 3 år 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...

nästan 3 år ago

Solved

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

nästan 3 år 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...

nästan 3 år 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...

nästan 3 år 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...

nästan 3 år 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...

nästan 3 år 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: ...

nästan 3 år 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...

nästan 3 år 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 [...

nästan 3 år 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

nästan 3 år ago

Solved

Determine if a row vector has NaN
Determine if a row vector x has NaN

nästan 3 år ago

Solved

Create a square matrix of zeros of even order
Create a square matrix of zeros of even order

nästan 3 år ago

Solved

Test if a number is numeric or not
Test if a number is numeric or not

nästan 3 år ago

Solved

Calculate the logarithm of number
Calculate the logarithm of number x

nästan 3 år ago

Solved

calculate the tangent of angle in radians
Calculate the tangent of angle in degrees

nästan 3 år ago

Solved

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

nästan 3 år ago

Solved

Calculate square and cube of number
Calculate square and cube of number x

nästan 3 år ago

Solved

An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:* Many important observations in math and science can be described by short, but powerful, equations...

nästan 3 år 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].

nästan 3 år 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]

nästan 3 år 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...

nästan 3 år ago