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.

Question

MEX api and interleaved complex arrays

Does MATLAB store complex data in interleaved format since R2018a? If you compile a MEX function with the -R2018a flag, you can...

ein Tag ago | 1 answer | 0

Answered

Reversible matrix in matlab

You want to identify a "regular matrix and non-singular matrix". Then testing only, if it is square and not a zero matrix ist no...

Reversible matrix in matlab

You want to identify a "regular matrix and non-singular matrix". Then testing only, if it is square and not a zero matrix ist no...

5 Tage ago | 0

Answered

Calculation precision changed in 2020b?

The ACOS function is numerically instable at 0 and pi. SUM is instable at all. A trivial example: sum([1, 1e17, -1]) .There are...

Calculation precision changed in 2020b?

The ACOS function is numerically instable at 0 and pi. SUM is instable at all. A trivial example: sum([1, 1e17, -1]) .There are...

5 Tage ago | 1

Answered

Why stock DOT function is suboptimally implemented

Just a comment: Under Matlab 2018b, Core i5-3320M CPU @ 2.60GHz: Elapsed time is 0.249669 seconds. dot(z,z) Elapsed time is ...

Why stock DOT function is suboptimally implemented

Just a comment: Under Matlab 2018b, Core i5-3320M CPU @ 2.60GHz: Elapsed time is 0.249669 seconds. dot(z,z) Elapsed time is ...

5 Tage ago | 0

Answered

How to concatenate matrices to calculate mean

As Steven has mentioned already, this is the main problem: "I have 40 matrices DJF1979_1980_125 to DJF2019_2020_125" Do not us...

How to concatenate matrices to calculate mean

As Steven has mentioned already, this is the main problem: "I have 40 matrices DJF1979_1980_125 to DJF2019_2020_125" Do not us...

5 Tage ago | 0

Submitted

ScaleTime

Fast linear interpolation of equally spaced data (C-MEX and M)

6 Tage ago | 10 downloads |

Answered

How to read data from a file into cell array keeping indents undisturbed

% Import file: Str = fileread('file.ext'); % Remove trailing line break to avoid appending an additional empty line: if ~is...

How to read data from a file into cell array keeping indents undisturbed

% Import file: Str = fileread('file.ext'); % Remove trailing line break to avoid appending an additional empty line: if ~is...

28 Tage ago | 0

| accepted

Answered

Not enough input arguments error

What about replacing: for j= 1:N if x(j)<beta1 & x(j)>beta2 f(1,j)=f02(x(j)); end if x(j)>beta1 & x(j)<...

Not enough input arguments error

What about replacing: for j= 1:N if x(j)<beta1 & x(j)>beta2 f(1,j)=f02(x(j)); end if x(j)>beta1 & x(j)<...

28 Tage ago | 0

Answered

command window no output

Check if you have shadowed the display function: w = cellstring(which('display', '-all')); fprintf('%s\n', w{:}) What do you ...

command window no output

Check if you have shadowed the display function: w = cellstring(which('display', '-all')); fprintf('%s\n', w{:}) What do you ...

etwa ein Monat ago | 0

Answered

Find string in the special file

S = fileread('R2_AS - Copy.txt'); i1 = [strfind(S, 'Szenario'), Inf]; i2 = strfind(S, 'has been created.'); width = numel(...

Find string in the special file

S = fileread('R2_AS - Copy.txt'); i1 = [strfind(S, 'Szenario'), Inf]; i2 = strfind(S, 'has been created.'); width = numel(...

etwa 2 Monate ago | 0

Answered

Namelengthmax value in different operating systems

The value of namelengthmax depends on the Matlab version only. It is the same for all operating systems. Identifiers can have ...

Namelengthmax value in different operating systems

The value of namelengthmax depends on the Matlab version only. It is the same for all operating systems. Identifiers can have ...

etwa 2 Monate ago | 0

Answered

Syntax Error using Fcn Block

You need round parentheses for indexing, not square brackets: (1/Mus)*(Ks*(u[3]-u[4])+Ct*(u([7]-u[2])+Kt*(u[6]-u[4])-u[5]) % =...

Syntax Error using Fcn Block

You need round parentheses for indexing, not square brackets: (1/Mus)*(Ks*(u[3]-u[4])+Ct*(u([7]-u[2])+Kt*(u[6]-u[4])-u[5]) % =...

etwa 2 Monate ago | 0

| accepted

Answered

how to compute the number of image from subfolder ?

fullfile(('.\databasee\')) is exactly the same as its input: '.\databasee\'. The unnecessary parentheses are confusing only. To...

how to compute the number of image from subfolder ?

fullfile(('.\databasee\')) is exactly the same as its input: '.\databasee\'. The unnecessary parentheses are confusing only. To...

etwa 2 Monate ago | 1

| accepted

Answered

Different machine precision for scalars and vectors?

The only difference is the display in the command window. Matlab tries to display vectors in an abbreviated format, execpt if yo...

Different machine precision for scalars and vectors?

The only difference is the display in the command window. Matlab tries to display vectors in an abbreviated format, execpt if yo...

etwa 2 Monate ago | 1

| accepted

Answered

Strange behavior of the editor in the forum

1.5 years later. I tried it again. I still cannot set a flag, delete an answer or insert an image or link. Whenever I try it, t...

Strange behavior of the editor in the forum

1.5 years later. I tried it again. I still cannot set a flag, delete an answer or insert an image or link. Whenever I try it, t...

etwa 2 Monate ago | 2

Answered

Combining 2 codes to make a number counter with user input

function v = Sample() Loop = true; Count = 0; v = []; while Loop a = input('Please input a number: '); if a >= ...

Combining 2 codes to make a number counter with user input

function v = Sample() Loop = true; Count = 0; v = []; while Loop a = input('Please input a number: '); if a >= ...

2 Monate ago | 0

Answered

regarding 'FOR LOOP' use to plot discrete impulse response

The question is not clear yet. Do you mean: delay = repmat(1, 1, 500); amplitiudes = repmat(0.1, 1, 500); % Alternati...

regarding 'FOR LOOP' use to plot discrete impulse response

The question is not clear yet. Do you mean: delay = repmat(1, 1, 500); amplitiudes = repmat(0.1, 1, 500); % Alternati...

2 Monate ago | 0

Answered

How can write loop for this algorithm?

I'm not sure, because the question is not completely clear to me. Perhaps: A = [1 1 2 2 3 3 3 4 4 8 9 10]; d = diff(A); v = f...

How can write loop for this algorithm?

I'm not sure, because the question is not completely clear to me. Perhaps: A = [1 1 2 2 3 3 3 4 4 8 9 10]; d = diff(A); v = f...

2 Monate ago | 0

Answered

counting number of textbox or patches in a matlab figure

% All text boxes: List1 = findall(HandleOfFigure, 'Type', 'uicontrol', 'Style', 'text') Count1 = numel(List1) % All patche...

counting number of textbox or patches in a matlab figure

% All text boxes: List1 = findall(HandleOfFigure, 'Type', 'uicontrol', 'Style', 'text') Count1 = numel(List1) % All patche...

2 Monate ago | 0

Answered

mlock not working, variables getting cleared in function switch.

Create this file: function demo(In) persistent v switch lower(In) case 'lock' mlock disp('locked'...

mlock not working, variables getting cleared in function switch.

Create this file: function demo(In) persistent v switch lower(In) case 'lock' mlock disp('locked'...

2 Monate ago | 0

Answered

nested k for loops for a parameter k

Start with simplyfying your code: Replace the 2 innermost loops: s = 0; for u1=1:2 for u2=1:2 s = s + t1(u1,v1,w1)*...

nested k for loops for a parameter k

Start with simplyfying your code: Replace the 2 innermost loops: s = 0; for u1=1:2 for u2=1:2 s = s + t1(u1,v1,w1)*...

2 Monate ago | 1

| accepted

Answered

Adding Two Arrays Alternatively to make Third Array

% Arbitrary test data: ForceX = rand(64, 1) + 1i * rand(64, 1); ForceY = rand(64, 1) + 1i * rand(64, 1); % Methode 1: Forc...

Adding Two Arrays Alternatively to make Third Array

% Arbitrary test data: ForceX = rand(64, 1) + 1i * rand(64, 1); ForceY = rand(64, 1) + 1i * rand(64, 1); % Methode 1: Forc...

2 Monate ago | 0

Answered

how to string scalar or character vector a text

You need Matlab R2018b to define stringe with double quotes. The screen shot looks like R2018a. Then use single quotes to create...

how to string scalar or character vector a text

You need Matlab R2018b to define stringe with double quotes. The screen shot looks like R2018a. Then use single quotes to create...

2 Monate ago | 0

Answered

why elseif (i==1) && j==m condition went unexecuted?

The condition "i==1 && j==m" appears twice: if i==1 && j==m % First time A(1,1)=1; elseif (i==...

why elseif (i==1) && j==m condition went unexecuted?

The condition "i==1 && j==m" appears twice: if i==1 && j==m % First time A(1,1)=1; elseif (i==...

2 Monate ago | 0

| accepted

Answered

Why Matlab does not read the input value?

This piece of code is called repeatedly. This shown code seems to be fine, so the behavior is caused the code, which calls this ...

Why Matlab does not read the input value?

This piece of code is called repeatedly. This shown code seems to be fine, so the behavior is caused the code, which calls this ...

2 Monate ago | 0

Answered

uiopen vs audioread, is there an advantage to one over the other for .wav files?

The function uiopen and audioread have two different jobs. While the first opens Matlab files with the apropriate application, t...

uiopen vs audioread, is there an advantage to one over the other for .wav files?

The function uiopen and audioread have two different jobs. While the first opens Matlab files with the apropriate application, t...

3 Monate ago | 0

Answered

Slow SizeChangedFcn or ResizeFcn

The first version was not sufficient in all cases. In addition it is required to prevent a repeated entering of the code: funct...

Slow SizeChangedFcn or ResizeFcn

The first version was not sufficient in all cases. In addition it is required to prevent a repeated entering of the code: funct...

3 Monate ago | 0

Answered

Slow SizeChangedFcn or ResizeFcn

One solution is to ignore the built-in resize methods and use a specific WindowsButtonDownFcn to emulate a resizing. But reinven...

Slow SizeChangedFcn or ResizeFcn

One solution is to ignore the built-in resize methods and use a specific WindowsButtonDownFcn to emulate a resizing. But reinven...

3 Monate ago | 0

Answered

Is it possible to programmatically check whether MATLAB has been started with the "-nodisplay" option?

See also: https://www.mathworks.com/matlabcentral/answers/407059-if-matlab-desktop-elseif-matlab-nodesktop : usejava('desktop')...

Is it possible to programmatically check whether MATLAB has been started with the "-nodisplay" option?

See also: https://www.mathworks.com/matlabcentral/answers/407059-if-matlab-desktop-elseif-matlab-nodesktop : usejava('desktop')...

3 Monate ago | 1