Solved

What time can I drive after drinking?

At T o'clock, after a hard day of Matlab, I immediately start drinking and treat myself to N pints of tasty beer. Each beer I dr...

2 mois ago

Solved

Pascal's Equilateral triangle inside a Matrix!!!

Given a number of row 'n', generate the following pascal's matrix 'p' where spaces are filled by 'zeros'. number of row, n = ...

2 mois ago

Solved

Efficiency of a single phase Transformer

Calculate the efficiency of a single phase transformer whose KVA rating is A KVA, loading factor x,power factor p,full load copp...

2 mois ago

Solved

Float like a cannonball

Given gravity on earth (g=9.81 [m/s/s]) find the distance s [m] by a cannonball propelled at a speed of u [m/s] from the origin ...

2 mois ago

Solved

Crop an Image

A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. The element values ...

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

2 mois ago

Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the rolls is likely to be close to the expected value of a sin...

2 mois ago

Solved

Calculate Amount of Cake Frosting

Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

2 mois ago

Solved

Convert from Fahrenheit to Celsius

Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

2 mois ago

Solved

Calculate BMI

Given a matrix |hw| with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 inch = 2.54 centimet...

2 mois ago

Solved

Solve a System of Linear Equations

Given a constant input angle θ(theta) in radians, create the coefficient matrix(A) and constant vector(b) to solve the giv...

2 mois ago

Solved

Rescale Scores

Each column (except last) of matrix |X| contains students' scores in a course assignment or a test. The last column has a weight...

2 mois ago

Solved

Calculate a Damped Sinusoid

The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt).cos(2πft)| Given inputs λ ( |lambda...

2 mois ago

Solved

Plot Damped Sinusoid

Given two vectors |t| and |y|, make a plot containing a blue dashed line of |y| versus |t|. Mark the minimum value |m| of the...

2 mois ago

Solved

Find the Oldest Person in a Room

Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

2 mois ago

Solved

Get Next Combination

Return next combination For example three-element combinations of 1:5 1 2 3 1 2 4 1 ...

3 mois ago

Solved

Vogel-Dobbener entropy

*Vogel-Dobbener entropy* is a measure of dispersion for ordinal variables. Given an ordered list of distinct observations u_...

3 mois ago

Solved

Plot Line Specifications

Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...

4 mois ago

Solved

Parsing Expressions - Binary Arithmetic Operators I

Parse and evaluate expressions like these: '1 + 2' '51 - 78' '42 * 9' The only operators are +, -, *. Both argu...

5 mois ago

Solved

Write a code to give student grade

Write a code to give student ' pass' grade if he/she gets more than 49 in the exam, and 'fail' grade otherwise. ''Many of lif...

5 mois ago

Solved

CowBoy

A group of cowboys standing in circle form. They have one gun. The first cowboy shoot the cowboy beside him (second one) and giv...

5 mois ago

Solved

Ratio between sum of primes and sum of factors

Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

5 mois ago

Solved

Find left eigenvector of row stochastic matrix

Find the left eigenvector of the given stochastic matrix P that has eigenvalue 1. Normalize the vector so the sum of the entri...

5 mois ago

Solved

Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.

Given a matrix x, *using loops only* return a matrix y, in which all the zeros have "climbed" up to the top. That is, any zeros ...

5 mois ago

Solved

Get the mean digit

Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

6 mois ago

Solved

Permutation Via Multiplication

Given two numbers a and b, determine if the product ab is a permutation of the digits of a. For example, this is always true for...

6 mois ago

Solved

Angle between two vectors

Given 2 pairs of _cartesian co-ordinates_, determine the angle between the 2 vectors formed by the _points_ and the _origin_. An...

6 mois ago