# Jan

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.

**Statistics**

RANK**4**

of 282,044

REPUTATION**40,925**

CONTRIBUTIONS

**82** Questions

**15,231** Answers

ANSWER ACCEPTANCE **
80.49%
**

VOTES RECEIVED**9,495**

RANK**68** of 19,073

REPUTATION**12,698**

AVERAGE RATING**4.80**

CONTRIBUTIONS**52** Files

DOWNLOADS **302**

ALL TIME DOWNLOADS**113123**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Can I generalize a folder lookup location so that data can be accessed in more than one way?

The core of the problem is a messed up storage of files in a bunch of folders. Collecting the files in one shared folder would b...

2 months ago | 0

How do I close parallel button?

You can try: FEX: CmdWinTool CmdWinTool lean

2 months ago | 2

How can I select two out of 6 points for every page without loops?

n = 2; X = randi(40, 6, 3, n) mask = all(X >= 0 & X <= 30, 2) Y = reshape(X(cat(2, mask, mask, mask)), [], 3)

2 months ago | 0

| accepted

using feval or not?

I do not see problems with using feval. There have been a speed penalty in old versions, as far as I remember R2009a. But now t...

2 months ago | 0

| accepted

save matrix command works sometimes and sometimes gives error

Avoid strcat to create a folder name, but use fullfile, which cares for the correct separators. A try/catch block is the way to...

2 months ago | 0

Integration time step in ODE45 Matlab

The output time interval is the integration interval, so you can grab it e.g. in the outputfcn.

3 months ago | 0

Warning: Single line Edit Controls can not have multi-line text

res is a numerical array. You cannot insert it as string in handles.edit5. Display an image in an axes as image object.

3 months ago | 0

Why Euler's number e = 2.71828... is not a built-in constant in MATLAB?

What an epic discussion. Some levels less sophisticated: I needed exp(1) in a line of code called very frequently. exp() is an ...

3 months ago | 0

How to produce 1 and -1 in MATLAB

Exactly 50% or randomly? x = randi([0, 1], 1, 2000) * 2 - 1; y = [ones(1, 1000), -ones(1, 1000)]; y = y(randperm(y));

3 months ago | 1

Delete every nth element in array and increasing 1 NaN value per new row

Array = [1,2,3,4,5,6,7,8,9,10]; n = numel(Array); Out = nan(n - 2, n); for k = 2:n - 1 Out(k-1, 1:k:n) = Array(1:k...

3 months ago | 0

How should I recover.m file of the function in the toolbox?

You can ask a colleage for the original file. Of course with some tricks you can find a way to type the file here in the forum a...

3 months ago | 0

| accepted

delete special characters (\ / : * " < > |) in char

name_1 = '<Hello World>'; name_1 = erase(name_1, ["<", ">", "\", "/", ":", "*", """", "|"])

3 months ago | 1

Memory efficient alternative to sprandsym?

It would be useful to create the input by some commands in the example, such that the readers can run the code without your file...

3 months ago | 0

Why do I keep getting this error for subplot? Am I missing a toolbox or is the code wrong?

Please read the documentation of the command: subplot or doc subplot You call this command like subplot(m,n,p), where m and n...

7 months ago | 0

Nested mean function with omitnan

The problem is here: "What I would have expected would be the same as". This is not the way mean('omitnan') is working. So if yo...

7 months ago | 1

| accepted

No out of memory error but matlab crash

It is expected, that creating a bunch of large arrays (1st example) crash an application. You cannot do much gainst it, because ...

7 months ago | 1

How can I output a value in an array, exactly as it is.

01 is no valid notation of a number. Numerically leading zeros are not existing. Zeros multiplied by a power of ten are still ze...

7 months ago | 2

Unrecognized function or variable 'delta1'.

Exactly as the error message tells you: The variables or function "delta1" is not defined. Then this linemust fail: [x1, y1]=me...

7 months ago | 0

| accepted

Everytime i type in editor window, nothing comes out of the command window.

The editor is a tool to write scripts and functions. You save them as files, which can be called from other scripts or functions...

7 months ago | 1

| accepted

How to assign a name for every result in every iteration by using for loop

This is a really bad idea. Hiding an index in the name of a variable is a complicated method, which requires even more complicat...

7 months ago | 1

i have this error and i can't solve it

The error message tells you: "X must have one or two columns". How many columns does your X have? Fs = 16000; % fréquence d'éch...

7 months ago | 0

Keep pairs of corresponding elements in 2 vectors based on conditions

orange = [212929;213223;213482;213740;214013;214790]; green = [212765;213301;213822;214090;214240;214426;214941]; [x, s] ...

7 months ago | 2

| accepted

How to create a loop to run my ODE for two sets of data and then store each data set in two cell arrays.

I do not see the problem: Y0 = [3 1 0 0 0] Y1 = [4 2 0 0 0] tspan = 0:0.1:5; [tout{1}, yout{1}] = ode45(@rates, tspan, Y0)...

7 months ago | 0

| accepted

How do you include a mass matrix in ode45?

Simply by a matrix division inside the function to be integrated: dydt = M(t,y) \ f(t,y)

7 months ago | 1

Find elemet which are satisfy given condition

Your code is working: x = [1, 401, 400, 500, 10, 300]; x1 = zeros(numel(x), 1); for i = 1:numel(x) if x(i) <= 400 ...

7 months ago | 0

| accepted

Opening different folder in matlab using loop

The %g instead of %d format does what you want: vel = [1 1.5 2]; D1 = "D:\RESULTS\PRISTINE FRESH\OUTPUT_"; for check = 1:3 ...

7 months ago | 0

| accepted

Is it possible to prevent matlab from saving an m-file on "run"?

Of course changes can be taken back by Ctrl-Z easily, such that accidental input are no serious problem. Even the attack of the...

7 months ago | 0

Conversion of float to int16

The signals are not related by a linear transformation: The signals look similar, but the int16 version has a downwards trend...

7 months ago | 0

Convert them to grayscale. Write a function, convolve, which takes a filter, F, and an image, I, as input and calculates the 2D convolutions of I with F via the use of ‘for’

outImg(i,j) = result; end end end % <== This END closes the function % Load the input image img = imread('Old ...

7 months ago | 0

when i run this code it give me error Not enough input arguments. Error in GWO (line 23) Alpha_pos=zeros(1,dim);

The function requires.these input arguments: SearchAgents_no,Max_iter,lb,ub,dim,fobj. How do you define them? If you start the ...

7 months ago | 0