Answered
Find intersection between two curves
The intersection is the location, where both functions have the same value. Then their difference is 0. You can use fzero with ...

5 years ago | 0

| accepted

Answered
How to downsample cell arrays based on specific criteria?
It would be much easier to reduce the number of points before you convert the nermical data to cell arrays. See my answer in th...

5 years ago | 1

| accepted

Answered
Why is the upper axis grid not visible after exporting to .eps image
Did you enable the box? set(gca, 'Box', 'on')

5 years ago | 0

| accepted

Answered
Finding Maximum Iterations for False Position Method
The rule of thumb is to limit the runtime to a duration, the user can bear. So waiting for an hour to detect, that the algorithm...

5 years ago | 0

Answered
How can compute sequential occurrence of elements in a vector
x = [ 0 0 0 0 1 1 1 1 1 0 0 0 2 2 2 2 0 0 0 0 0 3 3 3 3 3 3]; change = [true, diff(x) < 0, true]; index = diff(find(change))

5 years ago | 1

| accepted

Answered
How can I transmit multiple variables to a function in the form of a single array?
You can use a struct: S.a = a; S.b = b; ... [output1,output2] = multi_input(S) function [output1,output2] = multi_input(S...

5 years ago | 0

| accepted

Answered
HOW CAN I SOLVE THIS?
What are the possible numbers in IEEE 754 floating point values between 1.0 and 2.0? x = 1.0 + k * 2^-52 with k = 0, 1, ... ...

5 years ago | 1

Answered
Generate cell of random numbers with same size arrays
Creating a large array only to split it into parts needs more RAM than creating the random matrices in parts directly: C = cell...

5 years ago | 1

| accepted

Answered
How can I record mouse clicks (left and right) with coordinates and time?
You can emulate this with WindowsAPI. Setting the window completely invisble does not work, because with Alpha=0.0 the mouse eve...

5 years ago | 0

Answered
Butterworth Bandpass Filter Design
See https://www.mathworks.com/matlabcentral/answers/273811-butterworth-filtering-with-bandpass-and-3-order

5 years ago | 0

| accepted

Answered
num2str format
What does "I get a number from an API: 8.1784e+17" mean? Is this a char vector, string or a UINT64 or double scalar? In the last...

5 years ago | 0

| accepted

Answered
How can I get a loop to process all ".avi" files in a folder, then produce the corresponding ".txt" and ".png" file?
function FileExample() Folder = uigetdir('','Select Input-folder'); FileList = dir(fullfile(Folder, '**', '*.avi')); % Select...

5 years ago | 0

Answered
Array indices must be positive integers or logical values.
Nn = 1:2:30; Nn(i) = 60; Without a further definition, i is a constant with the value sqrt(-1). So which element to you wan...

5 years ago | 0

Answered
Multiply two terms at a set distance apart from each other in an array
The loop method: array = rand(1, 950); for i = 1:950 - 23 v = array(i+23) * array(i) end Stephen's vectorized approach ...

5 years ago | 0

Answered
How to deal with nested arrays where the columns and rows are in different dimensions?
I do not undestand why "Text Nr.1" appears multiple times. If this is a typo only: In = {your cell}; Out = cell(size(In)); f...

5 years ago | 1

| accepted

Answered
multiple default files for uigetfile
Under Windows this works: % Select multiple M-files: [File, Folder] = uigetfile('*.m', 'Choose files', '', 'Multiselect', 'on'...

5 years ago | 0

Question


PARFOR in real applications
I've installed the Parallel Computing Toolbox for some experiments with my code. To my surprise none of the codes run faster wit...

5 years ago | 1 answer | 0

1

answer

Answered
How can I efficiently add multiple arrays generated in a loop?
EXP is very expensive. This is the bottleneck of your code. Instead of applying it to matrices produced by MESHGRID, provide th...

5 years ago | 0

Answered
Cumulative RMS in Matlab
Start with a mathematical definition of what you want to achieve. I guess you want this: x = rand(1, 100); % Your data % "Cu...

5 years ago | 0

| accepted

Answered
Same result but without ode45
ODE45 is a stepsize controlled Dormand Prince Integrator with local extrapolation. If you want to get exactly the same results,...

5 years ago | 0

Answered
How to change a sequence of integers?
Rule 1 is easy: x = [2 1 3 4 1 1 3 1 2 1 2 2 5 3 2]; m = strfind(x == 1, [false, true, false]); y = x; xm = x(...

5 years ago | 0

| accepted

Answered
How can I speedup this for loop and ismember?
Without having working inputs, we cannot run the function. Then it is not possible to improve the code reliably. Except for one ...

5 years ago | 0

| accepted

Answered
How to take each 10 rows and put it in different group
X = rand(2000, 512); Y = reshape(X, 10, 200, 512); % perhaps: Y = reshape(X, 200, 10, 512)? % perhaps PERMUTE() such that the...

5 years ago | 0

Answered
how to creat a Vectorization instead of a Double Loop
The most important part is "myfcn", which is not shown yet. Can it be called with an array as input? What does it reply? Only 0...

5 years ago | 0

Answered
transfer variables between functions?
Variables cannot be "transfered" between functions. You need to provide them as inputs and outputs. Combining GUI and the actua...

5 years ago | 0

| accepted

Answered
Using Euler's method as ODE-solver in Matlab
How was the step size determined to be h=1/18? The author of the code wanted it to be 1/18. What does Euler's method in the w...

5 years ago | 0

Answered
run the script without opening the figure, its possible?
There is no chance to guess, what your code does, if we cannot see it. Maybe there is no reason to display the images, maybe thi...

5 years ago | 0

Answered
For Loop through .wav files
See: FAQ: How to process a sequence of files Folder = 'insert your folder here'; % Sure that there is a sapce after your name?...

5 years ago | 0

Answered
Share X and Y Axes for tiled layout plot
I'd solve this with subplot: https://www.mathworks.com/matlabcentral/fileexchange/20003-panel https://www.mathworks.com/matlab...

5 years ago | 1

| accepted

Answered
Calling method in the GNU Scientific Library
You can create a C++-Mex function and call the library throught it. Unfortunately all inputs must be transposed, because Matlab ...

5 years ago | 0

Load more