It is easier to solve a problem than to guess, what the problem is.

Questions about FileExchange submissions are welcome - get my address from the code. I do not answer mails concerning questions in the forum.

Answered

How to create column vector by the transpose?

The quote ' is not the transpose operator, but the complex transposition. To be exact the tranpose operator is .' including t...

How to create column vector by the transpose?

The quote ' is not the transpose operator, but the complex transposition. To be exact the tranpose operator is .' including t...

8 hours ago | 1

| accepted

Answered

How to bring Data in usable form?

To be able to guess, what "usable" means, we need to know, what do you want to use the data for. Maybe you should convert the ti...

How to bring Data in usable form?

To be able to guess, what "usable" means, we need to know, what do you want to use the data for. Maybe you should convert the ti...

8 hours ago | 1

Answered

When using ODE45, can I specify a variable to assume two different values during the timespan?

ODE45 is designe to integrate smooth functions only. To change a parameter you have to integrate in chunks: tSwitch1 = 10.0 tS...

When using ODE45, can I specify a variable to assume two different values during the timespan?

ODE45 is designe to integrate smooth functions only. To change a parameter you have to integrate in chunks: tSwitch1 = 10.0 tS...

8 hours ago | 0

Answered

Loop to iterate ode45 function

figure; axes('NextPlot', 'add'); for e = 0:0.2:1 [t, x] = ode45(@(t, y) F(t, y, e), [0, 20], [0, 1]); plot(t, x(:,1)...

Loop to iterate ode45 function

figure; axes('NextPlot', 'add'); for e = 0:0.2:1 [t, x] = ode45(@(t, y) F(t, y, e), [0, 20], [0, 1]); plot(t, x(:,1)...

9 hours ago | 0

| accepted

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

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

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

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

10 hours 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')

Why is the upper axis grid not visible after exporting to .eps image

Did you enable the box? set(gca, 'Box', 'on')

10 hours ago | 0

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

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

10 hours 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))

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

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

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

10 hours ago | 0

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

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

22 hours ago | 0

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

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

1 day ago | 0

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

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

1 day ago | 0

Answered

Butterworth Bandpass Filter Design

See https://www.mathworks.com/matlabcentral/answers/273811-butterworth-filtering-with-bandpass-and-3-order

Butterworth Bandpass Filter Design

See https://www.mathworks.com/matlabcentral/answers/273811-butterworth-filtering-with-bandpass-and-3-order

1 day ago | 0

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

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

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

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

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

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

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

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

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

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

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

multiple default files for uigetfile

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

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

3 days ago | 0 answers | 0

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

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

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

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

3 days ago | 0

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

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

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

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

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

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

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

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

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

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

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

transfer variables between functions?

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

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

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

4 days ago | 0