Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...
5 years ago
Solved
Mid-term report
You just got your mid-term report, but it's full of ones and twos :(. So before you give it to your parents, you change it, in o...
5 years ago
Solved
Box
Give the volume of a box, x is equal to the body diagonal.
5 years ago
Solved
Approximate the cosine function
Without using MATLAB trigonometric functions, calculate the cosine of an argument |x| to a precision of |0.0001|
*Hint:* You ...
5 years ago
Solved
Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|.
Example:
Input: a = 4; b = 7; c ...
Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match.
* If they match, create an output variable |z|...
5 years ago
Solved
Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...
5 years 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...
5 years ago
Solved
Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...
5 years ago
Solved
Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas:
* 1 kilogram = 2.2 pounds
* 1 ...