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

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

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

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

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

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

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

2 years ago

Solved


Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

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

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

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

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

3 years ago

Solved


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

3 years ago

Solved


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

3 years ago

Solved


Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

3 years ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

3 years ago

Solved


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

3 years ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

6 years ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

6 years ago

Answered
Minimum value of select cell elements?
Hi, I propose you the following solution: % The 20x50 cell array is transformed into a 20x(10000) matrix. elems ...

6 years ago | 0

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

6 years ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

6 years ago

Answered
How can I remove a set of given peaks such as the peaks located at (7.9000,0.9989) and (14.1000, 0.9993) in the following code? I want to be able to do this even when the plot expands and has many more peaks.
Hi, it can be done by replacing the undesired peaks by nan values. In your case, it will be: % The first two lines of you...

6 years ago | 0

Answered
Ode45 would not converge with the following statement
Hi, I guess the "y" vector contains a NaN, and as a consequence "C" contains also NaNs. This happen even if B is equal to zero (...

6 years ago | 2

| accepted

Answered
I would like to get an cell array output by matching 2 cell arrays and returning with corresponding matched values from other cell array.
Please, let me know if the following sentence solves your problem: B(ismember(B(:,1),A),:)

6 years ago | 0

| accepted

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

6 years ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

6 years ago

Solved


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

6 years ago

Answered
ODE to answer projectile question
I hope this will help you: clc; clear variables; close all; % Parameters of the model S = rand(1); ...

6 years ago | 0

Answered
Interp1 wrong answer
Instead of the function interp1, you could use this sentence: yi = polyval(polyfit(X,Y,1),xi) In Matlab '9.4.0.885841 (R...

6 years ago | 0

Load more