已回答
subtraction of each row with every other row
A=[1,2,3,4,5; 6,7,8,9,10; 11, 12, 13, 14, 15;16, 17, 18, 19, 20]; c = nchoosek(1:size(A, 1),2); c2 = [c; fliplr(c)]; B = ze...

4 years 前 | 0

已回答
Which is more efficient for iterative programs: while loops or terminating with an if statement and break command?
for the "%if statement with break": Suppose someArray has a million elements in it. If, in the 10th iteration, criteria(i)==1, ...

4 years 前 | 0

提问


How to remove for-loop in computing a vector of sums?
How to compute rcross vector without the for-loop? rcross = zeros( length(elementProduct) - prefixLen , 1 ); for ii = 1:...

4 years 前 | 0 个回答 | 0

0

个回答

已回答
Why do we transfer the image into double?
MATLAB when using mixed mode arithmetic, will try to save memory. 250 + 10 = 260, right? >> x =double(250) + uint8(10); >> x ...

4 years 前 | 1

已回答
How to write multiple image from a for loop to a dir
I copied your method of writing the images to files and there were no problems. Irgb = imread('Lena.jpg'); J = Irgb...

4 years 前 | 0

已回答
I want to loop reading in several images. and then perform analysis on those images.
sumImage = OriginalImage + SecondImage + ThirdImage + FourthImage + FifthImage + SixthImage + SeventhImage + Image8 + Image9; Y...

4 years 前 | 0

已回答
Not enough input arguments
Cannot speak to your simulink model, but the MATLAB code below runs without error. time = 1:1/100:1000; theta = -pi/2:pi/(max(...

4 years 前 | 0

已回答
In "Analyzing Cyclical Data with FFT" example, how the frequency was calculated?
If n is even, the following is equivalent to your code: f = linspace(2/n, 1, n/2) * maxfreq;

4 years 前 | 0

| 已接受

已回答
How to Cut multiple files from multiple folders in a for loop? Then return them to their own folders containing those cuts.
You can recursively find all files with a .wav extension using code from here: https://www.mathworks.com/matlabcentral/fileexch...

4 years 前 | 0

| 已接受

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

4 years 前 | 0

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

4 years 前 | 0

已回答
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 前 | 0

已回答
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 前 | 0

已回答
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 前 | 0

| 已接受

已回答
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 前 | 0

提问


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 前 | 2 个回答 | 0

2

个回答

已回答
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 前 | 0

提问


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 前 | 2 个回答 | 0

2

个回答

已回答
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 前 | 1

提问


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 前 | 2 个回答 | 0

2

个回答

提问


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 前 | 1 个回答 | 0

1

个回答

已回答
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 前 | 0

| 已接受

提问


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 前 | 1 个回答 | 0

1

个回答