Community Profile

# Jan

Last seen: Today Active 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.

All

#### Content Feed

View by

G-Code Reader not work and say error
The error message tells you, that there have been too many fopen() commands without an fclose() on the computer. If this concern...

ongeveer een uur ago | 0

Is it possible to get an email notification when a new question is raised?
About 1000 to 3000 Questions are posted in this forum per month. Do you really want to get this pile of mails? Many questions g...

ongeveer 2 uur ago | 0

Where/How exactly do I create an ODE Event Location Function?
As Walter has written already, use: [T,Y] = ode45 (@StraightRun, t, y0); % Instead of the old style: % [T,Y] = ode45 ('Strai...

ongeveer 2 uur ago | 0

How to store time data separated by colon (e.g 15:59:51:111) as a single data point in a matrix?
Use a table instead of a matrix: Time = datetime({'15:59:51:111'; '15:59:52:098'; '15:59:53:098'}, ... 'InputFormat', 'HH:...

ongeveer 2 uur ago | 0

I want to find all order-preserving shuffles of two vectors
3 methods for educational purpose: a = [3,1,1]; b = [4,2]; na = numel(a); nb = numel(b); % Indices of elements of the v...

ongeveer 2 uur ago | 0

| accepted

how to make this faster?
Some ideas: A = rand(2000, 2000, 5000); B = randi([0,3], 2000, 2000, 5000); tic; A(B==1)=2; toc tic; for k = 1:numel(...

ongeveer 12 uur ago | 0

Converting a list of binary numbers to a decimal numbers

2 dagen ago | 0

Can you help me with an error on my GUI program ?
Do not append folders to Matlab path only to import files. This is a source of unexpected behavior. Include only the folders con...

3 dagen ago | 0

How to preallocate 2D array before for loop?
Do not collect the points, but a list of their indices. If you use logical indexing, you can omit the expensive unique also: n ...

4 dagen ago | 1

Decrease spacing between plots in matlab
You find many code for modyfying the position of subplots in the FileExchange: https://www.mathworks.com/matlabcentral/fileexch...

4 dagen ago | 0

Automatic Download from a Url when the file of the date is inputted by the user
This can be implemented with sprintf() or compose() easily. url_https='https://data.cosmic.ucar.edu'; for year = 2020:2022 % ...

4 dagen ago | 0

| accepted

Out of memory error
32*20*1024*2047*42* 8 byte per element => Your array snack uses 451 GB RAM. If alldat contains additional data, the total amount...

5 dagen ago | 0

After using griddata, standard deviation is changed.
Of course increasing the number of points by an interpolation reduces the standard deviation: std([1,100]) std(interp1([1, 2],...

5 dagen ago | 0

how to find a number in cell and make it NaN?
Start with a simple loop: A = {[1,2], [3,4], [5 31], [31,6]}; B = A; for k = 1:numel(B) b = B{k}; m = (b == 31); ...

5 dagen ago | 0

| accepted

Why this message appears?
The message is clear: "Out of memory" means, that the size of the data, you try to load, exceeds the available RAM. Install mor...

7 dagen ago | 0

Why the function "timeit" doesn't work correctly
timeit and tic/toc measure the runtime. If they determine a runtime of 4 seconds in Matlab R2014 and just 0.3 seconds in Matlab ...

7 dagen ago | 1

| accepted

Getitng error suggesting that I should "Use rotate(app, ...) to call this function.". How should I format my code?
rotate is a built-in function: https://www.mathworks.com/help/matlab/ref/rotate.html Use another name for your function.

10 dagen ago | 0

how can I plot y = (cos(t-2)/4)(rect(t+1)/6 )?
y = @(t) cos(t-2) / 4 .* rect(t + 1) / 6; fplot(y)

11 dagen ago | 0

How to concatenate numbers with ( ) bracket as cell type?
As Walter said already: If it contains parentheses ( and ), the elements of the cell cannot be numerical. in = [-5,21,-5;-5,21...

11 dagen ago | 0

| accepted

Using find() is faster than direct logical indexing?
No relevant difference in R2022a in the forum: A=randi(100, 5e3, 5e3); % Few elements only timeit(@() useFind(A)) timeit(@()...

11 dagen ago | 1

| accepted

speed up for and if loop
isnan replies trtue or false. There is no need to compare it with ==1 afterwards. nWasserhoehe = size(Wasserhoehe_HQ, 1); FRI_...

12 dagen ago | 0

Print a specific PDF file using its path?
Guessing, that you use Windows: Acrobat = '"C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"' PDFFile = '"C:\your.pdf"';...

13 dagen ago | 0

new_parameter(i) = T2(i) - T2(i-(time*mult)); In the first iteration the i.th element of the vector new_parameter is ca...

14 dagen ago | 1

missing parts of a figure when converting to pdf
Copied from my suggestion in the comments: Disable the clipping of the axes object: axes('Clipping', 'off')

14 dagen ago | 1

| accepted

How may I use reshape for this code?
Your loop method overwrites b(j) repeatedly. Setting count to 0 in two lines is confusing. Simpler: for j = 1:frame_number ...

14 dagen ago | 0

| accepted

How to calculate execution time in Matlab?
The direct method: tic x = sin(rand(1e4, 1e4)); toc The smart method: timeit(@() sin(rand(1e4, 1e4)))

16 dagen ago | 1

| accepted

Iteration repeat several times
Avoid including each variable in parentheses. This reduces the readability. Matlab processes terme from left to right. Then: i...

16 dagen ago | 0

| accepted

How to get internet time?
This java code does not run here in the forum. Maybe it is blocked by a firewall. Please try it in your local Matlab instance: ...

16 dagen ago | 0