Solved


Can we make a triangle?
Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

5 years ago

Solved


Find the sides of an isosceles triangle when given its area and height from its base to apex
Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

5 years ago

Solved


Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

5 years ago

Solved


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

5 years ago

Solved


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

5 years ago

Solved


Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

5 years ago

Solved


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

5 years ago

Solved


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

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

5 years ago

Solved


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


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

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

5 years ago

Solved


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...

5 years ago

Solved


Solve a System of Linear Equations
*Example*: If a system of linear equations in _x&#8321_ and _x&#8322_ is: 2 _x₁_ + _x₂_ = 2 _x₁...

5 years ago

Solved


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

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

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

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

5 years ago

Answered
How to use a default color in a graph?
histogram(X, 'FaceColor', [0 0.4470 0.7410]);

5 years ago | 0

| accepted

Answered
Extract first x characters in specific table column and place them in new column.
data = table(["aaaaaa"; "bbbbbbb"; "ccccccc"], [2.99; 2.99; 3.99]); data.Properties.VariableNames=["Name", "Value"]; newName =...

5 years ago | 1

| accepted

Answered
How do I Input both x-coordinates and y-coordinates into the findpeaks function?
[pks, locs, w] = findpeaks(s, x, ...) doc findpeaks for details.

5 years ago | 0

Answered
divide a matrix based on the presence of a coefficient
A = randi(5, [80, 4]); % your data u = unique(A(:, 4)); % unique values of column 4 for i=1:length(u) B{i,1} ...

5 years ago | 0

Answered
Repeating sequence in xlabel
a = gca; a.XTick = (1:160); % (0:5:160) a.XTickLabel = string(mod(0:159, 20)+1); % mod(0:5:160, 20) This repeats the lab...

5 years ago | 1

| accepted

Answered
How to find the 4th special number among pentagonal and triangular numbers
n = 1:5000; p = (3*n.^2 - n) / 2; t = (n.^2 + n ) /2; a = intersect(p, t); disp(a) The special number is 7906276

5 years ago | 0

| accepted

Answered
How to type an auto-correlation function in MATLAB
Try the following N=1000; x = randn(N+1, 1); M = 20; R = zeros(M+1, 1); for n=0:M for k=0:N-n R(n+1) = R(n+1)...

5 years ago | 0

| accepted

Answered
title according to the file name
filename = "abc"; load(filename, "x", "y"); plot(x, y) title(sprintf("File name: %s", filename));

5 years ago | 0

Answered
Problem with while loop
Change while G < 1 G = F1.*sig1 + F11.*sig1.^2 + F2*sig2 + F22.*sig2.^2 + F3.*sig3 + F33.*sig3.^2 - 1; end to: G = F1.*...

5 years ago | 1

| accepted

Load more