A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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.

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

environ 5 ans il y a

A résolu


Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

Réponse apportée
How to use a default color in a graph?
histogram(X, 'FaceColor', [0 0.4470 0.7410]);

environ 5 ans il y a | 0

| A accepté

Réponse apportée
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 =...

environ 5 ans il y a | 1

| A accepté

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

environ 5 ans il y a | 0

Réponse apportée
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} ...

environ 5 ans il y a | 0

Réponse apportée
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...

environ 5 ans il y a | 1

| A accepté

Réponse apportée
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

environ 5 ans il y a | 0

| A accepté

Réponse apportée
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)...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
title according to the file name
filename = "abc"; load(filename, "x", "y"); plot(x, y) title(sprintf("File name: %s", filename));

environ 5 ans il y a | 0

Réponse apportée
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.*...

environ 5 ans il y a | 1

| A accepté

Charger plus