Community Profile

photo

Jan


Last seen: Today
13,641 total contributions since 2009

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.

Jan's Badges

  • Explorer
  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • Grand Master
  • Revival Level 4
  • 36 Month Streak
  • Thankful Level 4
  • Knowledgeable Level 4
  • First Answer
  • Promoter
  • Commenter
  • Solver

View details...

Contributions in
View by

Answered
Safely interrupt a script/function
You can open a small window, which contains a stop button. Pressing this button sets a local variable, which can be checked from...

1 day ago | 0

Answered
Open image in Gui from menu
Unrecognized property 'XLim' for class 'matlab.graphics.primitive.Image'. XLim belongs to the axes. In the line: handles.Image...

1 day ago | 0

Answered
How to operate properly with multidimensional matrices and cells.
"For the other two, however, it goes wrong:" No, nothing goes wrong. This is exactly what is expected and needed. Only the dis...

1 day ago | 0

| accepted

Answered
Help needed in solving a matrix equation
A= [0,1;1,1]; B= [0,1;1,1]; Q= [2,0;0,4]; R= [0.5,0;0,0.25]; syms p11 p12 p21 p22 P = [p11, p12; p21, p22]; eqn = P * A + ...

3 days ago | 1

Answered
I dont know what to do
Remove the semicolons from these lines: x; y1; y2; y3; y4; The trailing semicolon suppresses the output. Therefore "x;" sh...

3 days ago | 1

Answered
FiltFilt function giving NaN values
I try to run your code guessing some inputs: srate = 1000; [b, a] = ellip(14, 5, 30, 2*(170/srate), 'low'); lpfSig = filtfil...

4 days ago | 0

Answered
How to insert data with fopen ?
fmt = [repmat('%.2f ', 1, 32). '\n']; ftempd = fopen('tempd.r2c', 'w'); fprintf(ftempd, fmt, tempd.'); fclose(ftempd);

4 days ago | 0

Answered
Run into "Paused: Press any key"
This problem appeared in R2016a already: https://www.mathworks.com/matlabcentral/answers/278430-why-does-program-execution-hang-...

5 days ago | 0

Answered
Formating all values of a structure field
No, you cannot access nested fields of a struct array in Matlab directly. You need a loop.

5 days ago | 0

| accepted

Answered
Cheat for preallocation requirement
x = []; for i = 1:1e5 x(end+1, :) = 1:10; end Here you allocate sum(1:1e5) * 10 * 8 bytes: 400 GB. c = {}; for i=1:1e5...

5 days ago | 0

Answered
the user will be asked to input number which is good but the problem is how can I make that as numbers and letters for example 2x and put it in matrix
This is a really complicated task, which is prone to bugs. How do you want to treat "2x" compared to "x2"? If "x" is a variable,...

5 days ago | 0

Answered
Subtract 1 from variable each second
counter = 100; TimerH = timer('TimerFcn', @doCount, 'ExecutionMode', 'fixedRate', ... 'Period', 1.0, 'UserData', counter...

5 days ago | 0

| accepted

Answered
Copy Multiple figures to the clipboard
The OS has a single clipboard only. There are some 3rd party apps, which offer more bins in the clipboard, but it is not easy to...

5 days ago | 0

Answered
How do I store the values of a for loop in a matrix array?
One solution might be indexing the output ... mat(u, u0, v, v0) = delta2(u, u0, v, v0); ... But this can be simplifi...

6 days ago | 0

Answered
Recover Corrupt Matlab File
What do you call "Matlab files"? which file extension do they have? M, P, MAT, MLX, ...? Based on the information "random chara...

6 days ago | 0

| accepted

Answered
Concatenating multiple cells in a single matrix
The conversion from numeric to string and back to numeric is an expensive indirection. n = 8; p = 2.^(0:n-1); for col = 1 : n...

6 days ago | 0

Answered
An UndefinedFunction error thrown by parfor but not for
Constants defined in scripts cannot be identified by the Matlab, when it parses the parfor block. In addition such scripts have ...

6 days ago | 3

| accepted

Answered
how to read multiple file from single .mat file
I assume you use the term "file", but you mean "variable". Calling load() without catching the output, creates variables dynami...

6 days ago | 1

| accepted

Answered
Could someone please explain what is wrong in my function?
function [Sign] = signum(A) The indices (r,c) belongs to the caller of the function, not inside the function. You call this fun...

6 days ago | 0

Answered
Text doesn't change in guide while i can see it change in the commande window
It is not the cause of your problems, but global variables are a shot in your knee. Avoid them consequently. Instead of searchin...

6 days ago | 1

| accepted

Answered
Error in sort function when grouping events
Use the debugger: dbstop if error Afterwards start your code again. When Matlab stops at the error, what is the contents of rp...

6 days ago | 0

Answered
How to combine matrices with different size but preserve elements with same value?
Do you mean union? A = [1; 5; 8; 9]; B = [1; 2; 4; 5; 7; 9]; C = union(A, B)

6 days ago | 0

| accepted

Answered
How to sum specific elements of a matrix
The most efficient solution is to ask in the forum, because this is faster than solving this problem by your own ;-) X = randi(...

6 days ago | 0

Answered
Calculating Integral using Array Input
You do need a loop to get the best solution. Remember that integral is an adaptive method, which creates finer grids until a cer...

6 days ago | 0

| accepted

Answered
I have P=[2 3 4 0 5 1 0 2 ]; and I want to create a loop to remove zeros from P and calculate C, description in the code
P = [2 0 4 0 5 1 2 0 ]; zeroIndex = find(P == 0); for k = 1:numel(zeroIndex) Q = P; Q(zeroIndex(k)) = []; ... Ins...

6 days ago | 0

| accepted

Answered
Solve first ode using ode45
You can modify the examples of the documentation easily, see: doc ode45 Temperature0 = 6.2; % Your initial value [Time...

6 days ago | 0

Answered
exit from a nested loop
"I correctly exit from the inner while loop but afterwards it does not increment i" Why do you assume this? The outer loop is n...

8 days ago | 1

| accepted

Answered
Group files with same names
Folder = 'D:\Your\Data\Folder'; FileList = dir(fullfile(Folder, '*.jpg')); FileName = {FileList.name}; Name = unqiue(st...

8 days ago | 0

Answered
"Access Elements of a Nonscalar Structure Array" issue
You cannot access fields of deeply nested structs in Matlab. You need a loop to do this.

8 days ago | 1

| accepted

Load more