40,940 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Answered

lsqcurvefit help - Field assignment to a non-structure array object

lsqcurvefit must have parameter order objective. @model_1 or @model_2 x0. init in both cases xdata. a(1:end-1) in both cases ...

lsqcurvefit help - Field assignment to a non-structure array object

lsqcurvefit must have parameter order objective. @model_1 or @model_2 x0. init in both cases xdata. a(1:end-1) in both cases ...

15 hours ago | 0

Answered

How to count number of times code has been run (is this even possible)?

function write_data_to_excel(data) persistent counter if isempty(counter); counter = 0; end counter = counter + 1...

How to count number of times code has been run (is this even possible)?

function write_data_to_excel(data) persistent counter if isempty(counter); counter = 0; end counter = counter + 1...

1 day ago | 0

| accepted

Answered

An indexing expression on the left side of an assignment must have at least one subscript. ???

n_vec = zeros(1, length(x)); By the way: are you sure that you want x(i) to be multiplied twice in the expression? Once when y...

An indexing expression on the left side of an assignment must have at least one subscript. ???

n_vec = zeros(1, length(x)); By the way: are you sure that you want x(i) to be multiplied twice in the expression? Once when y...

1 day ago | 0

Answered

How to increase the size of an image

But with this method the image resolution changes, if I'm not mistaken. You are mistaken. imresize() does not invent informatio...

How to increase the size of an image

But with this method the image resolution changes, if I'm not mistaken. You are mistaken. imresize() does not invent informatio...

1 day ago | 1

| accepted

Answered

Use inputdlg to recall variables based on name

Store them as fields of a struct. Or use the names as keys of a containers.Map . Also consider building a uicontrol('style', 'l...

Use inputdlg to recall variables based on name

Store them as fields of a struct. Or use the names as keys of a containers.Map . Also consider building a uicontrol('style', 'l...

1 day ago | 0

Answered

Can someone help me plot?

Keep your a and c symbolic until later. Like syms a x c real f(x) = (x)*sinh(a*x); %first integral on left hand side g(x) = ...

Can someone help me plot?

Keep your a and c symbolic until later. Like syms a x c real f(x) = (x)*sinh(a*x); %first integral on left hand side g(x) = ...

1 day ago | 0

Answered

how to run Gpu and Cpu in parallel in for loop?

You cannot do that with parfor or spmd. What you can perhaps do is use parfeval to submit tasks associated with various resourc...

how to run Gpu and Cpu in parallel in for loop?

You cannot do that with parfor or spmd. What you can perhaps do is use parfeval to submit tasks associated with various resourc...

1 day ago | 1

| accepted

Answered

How can i have together in the same cell, lines with number values and one line with duration in HH:mm:ss:SSS?

You cannot change how the variable browser outputs non numeric values. There is only limited support for changing how the variab...

How can i have together in the same cell, lines with number values and one line with duration in HH:mm:ss:SSS?

You cannot change how the variable browser outputs non numeric values. There is only limited support for changing how the variab...

1 day ago | 0

Answered

Error in Parfor, The variable x in a parfor cannot be classified

Suppose i of 7 were executed first because parfor executes in any order. calculating that needs x 1 to x 6. hypothetical it pick...

Error in Parfor, The variable x in a parfor cannot be classified

Suppose i of 7 were executed first because parfor executes in any order. calculating that needs x 1 to x 6. hypothetical it pick...

1 day ago | 1

Answered

how to select a proper version of an Image Processing Toolbox?

None of the R2017a Update 1, 2, or 3 affect Image Processing Toolbox, so just install the only one the R2017a installer will per...

how to select a proper version of an Image Processing Toolbox?

None of the R2017a Update 1, 2, or 3 affect Image Processing Toolbox, so just install the only one the R2017a installer will per...

2 days ago | 0

Answered

When I integrate a constant over Tp I should get the constant but I don't?

syms t T = 2 * sym('pi'); %use symbolic pi instead of numeric pi ao=(1/T)*int(100.0,t,0,T)

When I integrate a constant over Tp I should get the constant but I don't?

syms t T = 2 * sym('pi'); %use symbolic pi instead of numeric pi ao=(1/T)*int(100.0,t,0,T)

2 days ago | 1

Answered

How do I import and read a large binary file?

filename = 'MySDRFile.bin'; %as appropriate seconds_to_read = 1; %{ Fs = 997990000*2; %sampling frequency... needed to...

How do I import and read a large binary file?

filename = 'MySDRFile.bin'; %as appropriate seconds_to_read = 1; %{ Fs = 997990000*2; %sampling frequency... needed to...

2 days ago | 2

| accepted

Answered

How to extract certain rows from an excel file?

MATLAB cannot know which rows satisfy your time bounds until it has read the data. If you can count on the times being 10 secon...

How to extract certain rows from an excel file?

MATLAB cannot know which rows satisfy your time bounds until it has read the data. If you can count on the times being 10 secon...

2 days ago | 0

Answered

Error using lsqcurvefit (line 262) Function value and YDATA sizes are not equal.

You have function C =kinetics(theta,t) The input values in the first parameter, theta, will be the proposed parameter values. ...

Error using lsqcurvefit (line 262) Function value and YDATA sizes are not equal.

You have function C =kinetics(theta,t) The input values in the first parameter, theta, will be the proposed parameter values. ...

2 days ago | 0

Answered

Adding Bias To Random Walk

There was a recent question in which someone asked for going immediately back to be prohibitted and for the probability of going...

Adding Bias To Random Walk

There was a recent question in which someone asked for going immediately back to be prohibitted and for the probability of going...

2 days ago | 0

Answered

Does MATLAB 2018b Support NVIDIA GeForce 2080 Ti RTX For Creating/Training/Implementing Deep Learning Neural Networks, And, If So, Then Which Version Of CUDA Should I Use?

https://www.mathworks.com/matlabcentral/answers/426316-cuda-with-turing-gpu-and-neuralnetworktoolbox-in-2017b suggests a workar...

Does MATLAB 2018b Support NVIDIA GeForce 2080 Ti RTX For Creating/Training/Implementing Deep Learning Neural Networks, And, If So, Then Which Version Of CUDA Should I Use?

https://www.mathworks.com/matlabcentral/answers/426316-cuda-with-turing-gpu-and-neuralnetworktoolbox-in-2017b suggests a workar...

2 days ago | 0

Answered

how to divide image into 5*5 blocks

blockproc(YourImage, [5 5], @(block) nnz(~block.data), 'trimborder', false)

how to divide image into 5*5 blocks

blockproc(YourImage, [5 5], @(block) nnz(~block.data), 'trimborder', false)

3 days ago | 1

| accepted

Answered

When I use UIGETFILE function then the gui minimized how can I stop it to do this?

imshow() resizes the figure under the condition that "hold" is off and the axes is in the "default" position as-if it is the onl...

When I use UIGETFILE function then the gui minimized how can I stop it to do this?

imshow() resizes the figure under the condition that "hold" is off and the axes is in the "default" position as-if it is the onl...

3 days ago | 0

Answered

How to solve the complex integration?

(sum(x+b)/b)^a is a constant with respect to r, so you can logically replace this with syms C r s result = int(1 / (r*C + r), ...

How to solve the complex integration?

(sum(x+b)/b)^a is a constant with respect to r, so you can logically replace this with syms C r s result = int(1 / (r*C + r), ...

3 days ago | 0

Answered

Why crossover and mutation functions in GA was not considered while using integer variable indices (integer constrain)?

They are considered. The way that integer constraints are enforced is that ga() puts in its own CrossoverFcn and MutationFcn th...

Why crossover and mutation functions in GA was not considered while using integer variable indices (integer constrain)?

They are considered. The way that integer constraints are enforced is that ga() puts in its own CrossoverFcn and MutationFcn th...

3 days ago | 1

| accepted

Answered

I am getting error as Index in position 2 exceeds array bounds. Can anybody help me out of this.

for j=1:k Xj = X(ind==j,:); k has been constructed by size(m,1) . X(ind==j,:) is selecting by value not by position. T...

I am getting error as Index in position 2 exceeds array bounds. Can anybody help me out of this.

for j=1:k Xj = X(ind==j,:); k has been constructed by size(m,1) . X(ind==j,:) is selecting by value not by position. T...

3 days ago | 0

Answered

How to transform matlab output to a 'matlab code' form?

Use matlabFunction() instead. copy/paste of symbolic expressions is like eval() on those expressions, which is a problem becaus...

How to transform matlab output to a 'matlab code' form?

Use matlabFunction() instead. copy/paste of symbolic expressions is like eval() on those expressions, which is a problem becaus...

3 days ago | 0

Answered

How to create random binary matrix with specified number of ones in each row and column?

See https://www.mathworks.com/matlabcentral/answers/439541-how-to-create-a-random-binary-matrix-with-equal-number-of-ones-in-eac...

How to create random binary matrix with specified number of ones in each row and column?

See https://www.mathworks.com/matlabcentral/answers/439541-how-to-create-a-random-binary-matrix-with-equal-number-of-ones-in-eac...

3 days ago | 0

| accepted

Answered

How to create a random binary matrix with equal number of ones in each column and equal number of 1 in each row ?

N = 10; %number of 1s to place M = 20; %dimension of matrix maxtries = 10; %random placement can fail. How often to re...

How to create a random binary matrix with equal number of ones in each column and equal number of 1 in each row ?

N = 10; %number of 1s to place M = 20; %dimension of matrix maxtries = 10; %random placement can fail. How often to re...

3 days ago | 0

Answered

how to correct time ?

Serial date numbers are in days; entries from the file are in hours. You are taking a base time in days (a good step in itself) ...

how to correct time ?

Serial date numbers are in days; entries from the file are in hours. You are taking a base time in days (a good step in itself) ...

3 days ago | 0

| accepted

Answered

Derivative over double summation?

The derivative of absolute value is not well defined.

Derivative over double summation?

The derivative of absolute value is not well defined.

3 days ago | 0

Answered

Adding a forgotten space in a txt file - before working on it on matlab

https://www.mathworks.com/help/matlab/ref/matlab.io.text.fixedwidthimportoptions.html

Adding a forgotten space in a txt file - before working on it on matlab

https://www.mathworks.com/help/matlab/ref/matlab.io.text.fixedwidthimportoptions.html

3 days ago | 0

Answered

I want to the code to segment 3D Liver from CT scan with Artificial bee colony Algorithm

We get questions along these lines from time to time naming different algorithms such as ant colony or krill herd or wild boar h...

I want to the code to segment 3D Liver from CT scan with Artificial bee colony Algorithm

We get questions along these lines from time to time naming different algorithms such as ant colony or krill herd or wild boar h...

3 days ago | 0

Answered

Do I have a student version of Matlab or not?

Statistics and Machine Learning toolbox is not included in Student Version. The only thing included in Student Version is MATLAB...

Do I have a student version of Matlab or not?

Statistics and Machine Learning toolbox is not included in Student Version. The only thing included in Student Version is MATLAB...

3 days ago | 0