Answered
How can I fix the error?
Sometimes a simple transpose will solve the problem. Use size() and transpose accordingly.

4 years ago | 0

Answered
how to i check if matrix cotaining logical 1
One simple way: if sum(B) > 0

4 years ago | 0

Answered
biterr Error on 3D Matrix
Maybe I am not looking hard enough. >> the inputs must be either a vector or a matrix with mxn dimensions Only thing I saw in ...

4 years ago | 0

Answered
How to generate two independent white noise
An easy way to think about the mean over a sample not being what you expected is to consider a fair coin having a head (H, give ...

4 years ago | 0

Answered
Why is my code running so slowly in the while loop?
>>> while currentcycle > 1 currentcycle is not changing within the while-loop. You need to modify the value of currentcycle ...

4 years ago | 0

| accepted

Answered
Short time energy, st zero crossing etc.
See if this can help you with what you have already done. https://www.mathworks.com/matlabcentral/fileexchange/23571-short-time...

4 years ago | 0

Question


biterr Error on 3D Matrix
B = [1 2 3; 4 5 6; 7 8 9]; size(B) % ans = 3 3 biterr(B,B) % ans = 0 Why does biterr work here, but not below? A =...

4 years ago | 2 answers | 0

2

answers

Answered
Compare two text files from MATLAB Command Window using FC Windows 10 file comparison command
To handle spaces in filenames, I did the following: >> fn_baseline_str = 'A BC BASELINE.txt' >> fn_str = 'A BC.txt' ...

4 years ago | 0

Question


Compare two text files from MATLAB Command Window using FC Windows 10 file comparison command
Currently, I am using visdiff to compare two text files. I do not want the GUI popup, nor do I want to get the full visdiff outp...

4 years ago | 2 answers | 0

2

answers

Answered
There is an endless loop in the function "getCompleteIntervals".
I had a similar problem in MATLAB 2020a. I saw two single pre-allocated arrays defined before the parfor-loop. I made them doubl...

4 years ago | 1

Question


Plot only adjacent points that are close to each other
I got a good answer to my question: https://www.mathworks.com/matlabcentral/answers/543065-find-set-of-all-adjacent-points-that...

4 years ago | 2 answers | 0

2

answers

Question


Find set of all adjacent points that are close to each other
I would like to find in Y[n] a set of adjacent points that are close to each other, but I don't get all the desired points. For ...

4 years ago | 1 answer | 0

1

answer

Answered
List non-zero connected elements in a Matrix cluster given a starting bin
I took the brute force approach which appears to handle all the edge cases. I just mark one found bin at a time in recursive ca...

4 years ago | 0

| accepted

Question


List non-zero connected elements in a Matrix cluster given a starting bin
I used MATLAB's histcounts2 to create a 10 row by 7 col matrix, H. I would like to create a set of non-zero bins that are connec...

4 years ago | 1 answer | 0

1

answer

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

4 years ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

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

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

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

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

4 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


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


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


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

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


Add two numbers
Given a and b, return the sum a+b in c.

5 years ago

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

5 years ago

Load more