Answered

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

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

12 months ago | 0

Answered

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

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

12 months ago | 0

Answered

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

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

12 months ago | 0

Answered

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

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

12 months ago | 0

Answered

What are some recommended strategies for replicating image processing techniques used in FIJI for a 3d tiff stack, such as non-local means filter, in MATLAB?

See e.g.: https://www.mathworks.com/help/images/ref/imnlmfilt.html https://www.mathworks.com/matlabcentral/fileexchange/13176...

What are some recommended strategies for replicating image processing techniques used in FIJI for a 3d tiff stack, such as non-local means filter, in MATLAB?

See e.g.: https://www.mathworks.com/help/images/ref/imnlmfilt.html https://www.mathworks.com/matlabcentral/fileexchange/13176...

12 months ago | 0

| accepted

Answered

For loop vectorisation having structure arrays

What is the prupose of a vectorization here? Remember that vectorized code creates temporary arrays usually and this is expensiv...

For loop vectorisation having structure arrays

What is the prupose of a vectorization here? Remember that vectorized code creates temporary arrays usually and this is expensiv...

12 months ago | 1

| accepted

Answered

Cannot locate any files

Yes, Matlab Online does not access local files. See e.g. https://www.mathworks.com/matlabcentral/answers/1573628-matlab-online-s...

Cannot locate any files

Yes, Matlab Online does not access local files. See e.g. https://www.mathworks.com/matlabcentral/answers/1573628-matlab-online-s...

12 months ago | 1

Answered

What part of this for loop does not want to work with anything else than positive integers?

rE is a vector: rE = zeros(1,n); You cann address its elements with positive integers as indices: rE(1), rE(2), ... t contain...

What part of this for loop does not want to work with anything else than positive integers?

rE is a vector: rE = zeros(1,n); You cann address its elements with positive integers as indices: rE(1), rE(2), ... t contain...

12 months ago | 1

Answered

Error using evalin Undefined function or variable 'var'.

The variable var is created in the workspace of the callback function. It is not visible in other workspaces, e.g. in the comman...

Error using evalin Undefined function or variable 'var'.

The variable var is created in the workspace of the callback function. It is not visible in other workspaces, e.g. in the comman...

12 months ago | 1

| accepted

Answered

Why could matlab not find the appcontainer folder?

Unrecognized function or variable 'rmfield'. It seems like the complete Matlab path is destroyed. Please explain, what has happ...

Why could matlab not find the appcontainer folder?

Unrecognized function or variable 'rmfield'. It seems like the complete Matlab path is destroyed. Please explain, what has happ...

12 months ago | 0

Answered

Not Enough Input Arguments: Newtons Method/Jacobian Matrix

You define gradfun with 3 inputs: gradfun = @(x,y,z) ... In the code you call it with 1 input: gradfxk = gradfun(xnew); The ...

Not Enough Input Arguments: Newtons Method/Jacobian Matrix

You define gradfun with 3 inputs: gradfun = @(x,y,z) ... In the code you call it with 1 input: gradfxk = gradfun(xnew); The ...

12 months ago | 0

Answered

How to automatically update the value in a string in an edit box with a value in another edit box but still allow the user to overwrite this value?

Without GUIDE but a working demonstration: handles.FigH = figure; handles.Edit1 = uicontrol('Style', 'Edit', ... 'Units',...

How to automatically update the value in a string in an edit box with a value in another edit box but still allow the user to overwrite this value?

Without GUIDE but a working demonstration: handles.FigH = figure; handles.Edit1 = uicontrol('Style', 'Edit', ... 'Units',...

12 months ago | 0

| accepted

Answered

Permission error for PREFDIR when running a stand-alone application on a different system

If the preferences folder is hardcoded, such problems occur. Search in the code for the name of the folder an replace it by the ...

Permission error for PREFDIR when running a stand-alone application on a different system

If the preferences folder is hardcoded, such problems occur. Search in the code for the name of the folder an replace it by the ...

12 months ago | 0

Answered

Ways for faster torque interpolation

interp1 is slower than griddedInterpolant. You can created the interpolant outside the integration to save more time. A sever p...

Ways for faster torque interpolation

interp1 is slower than griddedInterpolant. You can created the interpolant outside the integration to save more time. A sever p...

12 months ago | 0

Answered

How to load a mat. file containing one big matrix

If the variable in the MAT file has more than 2GB, it must have the v7.3 format. You try to extract a 994x961x3346 subarray, wh...

How to load a mat. file containing one big matrix

If the variable in the MAT file has more than 2GB, it must have the v7.3 format. You try to extract a 994x961x3346 subarray, wh...

12 months ago | 0

Answered

Combining masks in 4D matrix

With FEX: RunLength : s = size(mask); mask = reshape(mask, [], s(4)); for k = 1:size(mask, 1) % [EDI...

Combining masks in 4D matrix

With FEX: RunLength : s = size(mask); mask = reshape(mask, [], s(4)); for k = 1:size(mask, 1) % [EDI...

12 months ago | 0

| accepted

Answered

Does dsolve benefit from multiple cores?

Open the TaskManager and look at the CPU usage. Does dsolve use one or all cores? This is a strong hint to decide, if it is mult...

Does dsolve benefit from multiple cores?

Open the TaskManager and look at the CPU usage. Does dsolve use one or all cores? This is a strong hint to decide, if it is mult...

12 months ago | 1

Answered

Plot line doesn't follow function

You determine the corret values, but draw them in random order. Sorting cleans the diagonalish lines: x_total = zeros(1, 1000...

Plot line doesn't follow function

You determine the corret values, but draw them in random order. Sorting cleans the diagonalish lines: x_total = zeros(1, 1000...

12 months ago | 0

| accepted

Answered

How do I create a random number generator using congruent method

A very cheap linear congruential RNG with parameters suggested by Knuth: function a = rng_cheap % On-line Numerical Recipes in...

How do I create a random number generator using congruent method

A very cheap linear congruential RNG with parameters suggested by Knuth: function a = rng_cheap % On-line Numerical Recipes in...

12 months ago | 0

| accepted

Answered

Problems running the code in Mac

This will not run on a PC also. If M_.param_names is a 54x8 char, you cannot use braces for indexing, because they work for cell...

Problems running the code in Mac

This will not run on a PC also. If M_.param_names is a 54x8 char, you cannot use braces for indexing, because they work for cell...

12 months ago | 0

| accepted

Answered

Error in saving data

As the message tells you: Use a MAT file version 7.3 . You can find instructions by doc save. save('File.mat', 'YourVariable', ...

Error in saving data

As the message tells you: Use a MAT file version 7.3 . You can find instructions by doc save. save('File.mat', 'YourVariable', ...

12 months ago | 1

Answered

How to index variables in two combined function for overwriting data

With some bold guessing: X0 = 1.5; Y0 = 1.5; Z0 = 3.0; Theta0 = 30; Phi0 = 90; K = 4; X = [X0 zeros(1,K)]; Y = [Y0 zeros...

How to index variables in two combined function for overwriting data

With some bold guessing: X0 = 1.5; Y0 = 1.5; Z0 = 3.0; Theta0 = 30; Phi0 = 90; K = 4; X = [X0 zeros(1,K)]; Y = [Y0 zeros...

12 months ago | 0

| accepted

Answered

repeat the code with different value each time

w = rand(6, 222); index = 1:6:size(w, 2); result = zeros(1, numel(index)); for k = 1:numel(index) aw = w(:, index(k):ind...

repeat the code with different value each time

w = rand(6, 222); index = 1:6:size(w, 2); result = zeros(1, numel(index)); for k = 1:numel(index) aw = w(:, index(k):ind...

12 months ago | 0

| accepted

Answered

my error in the write n!+1 = 0 mod n

nq=factorial(n(i)))+1; % ^ Here are more closing then opening parentheses. Whenever you mention an error in t...

my error in the write n!+1 = 0 mod n

nq=factorial(n(i)))+1; % ^ Here are more closing then opening parentheses. Whenever you mention an error in t...

12 months ago | 1

Answered

The code works but it gives this warning. How to remove this warning?

You call the function L2_Array in ByAskic.m with the arguments 6 and 10. Inside L2_Array you calculate N_on_each_axis = (N-1)/...

The code works but it gives this warning. How to remove this warning?

You call the function L2_Array in ByAskic.m with the arguments 6 and 10. Inside L2_Array you calculate N_on_each_axis = (N-1)/...

12 months ago | 1

Answered

How can I separate data into multiple groups?

data = [2416.015, 127.402, 382.165, 127.425, 127.3387, 127.406, 637.001, 127.405, 2240.913, ... 2257.54, 241.801, 3064....

How can I separate data into multiple groups?

data = [2416.015, 127.402, 382.165, 127.425, 127.3387, 127.406, 637.001, 127.405, 2240.913, ... 2257.54, 241.801, 3064....

12 months ago | 0

Answered

What can we do with the thread "license-manager-error-9"?

From a discussion in the comments on the concerned page: Jestzer on 28 Feb 2023 at 23:32 This is already in the answer. Why di...

What can we do with the thread "license-manager-error-9"?

From a discussion in the comments on the concerned page: Jestzer on 28 Feb 2023 at 23:32 This is already in the answer. Why di...

12 months ago | 0

Answered

Not enough input argument for GUI

"Not enough input arguments" mean, that you call a function with less input arguments that needed. This line; [tsol,xsol] = od...

Not enough input argument for GUI

"Not enough input arguments" mean, that you call a function with less input arguments that needed. This line; [tsol,xsol] = od...

12 months ago | 0

| accepted

Answered

Using ODE45 with a matrix as input to my function

You can abbreviate: function dxdt = UseGamma(t,x,Gamma) Gamma y = Gamma*x; dxdt = zeros(size(x)); dxdt(1) = y(1); dxdt(2) ...

Using ODE45 with a matrix as input to my function

You can abbreviate: function dxdt = UseGamma(t,x,Gamma) Gamma y = Gamma*x; dxdt = zeros(size(x)); dxdt(1) = y(1); dxdt(2) ...

12 months ago | 0

| accepted

Answered

How do I bugfix a builtin function? (How do I call a shadowed function?)

"I have 'DefaultFigureUnits' set to 'normalized' on my installation." - This is a bad idea which can and will cause unexpected b...

How do I bugfix a builtin function? (How do I call a shadowed function?)

"I have 'DefaultFigureUnits' set to 'normalized' on my installation." - This is a bad idea which can and will cause unexpected b...

12 months ago | 1