Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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.

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

Risolto


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

oltre 3 anni fa

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

oltre 3 anni fa | 0

| accettato

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

oltre 3 anni fa | 1

| accettato

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

oltre 3 anni fa | 0

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

oltre 3 anni fa | 0

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

oltre 3 anni fa | 1

| accettato

Risposto
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

oltre 3 anni fa | 0

| accettato

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

oltre 3 anni fa | 0

| accettato

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

oltre 3 anni fa | 0

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

oltre 3 anni fa | 1

| accettato

Carica altro