43.047 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

output of k means clusters "idx"

idx will be a vector which has as many entries as there are rows in X. The j'th entry, idx(j) tells you the cluster number that...

output of k means clusters "idx"

idx will be a vector which has as many entries as there are rows in X. The j'th entry, idx(j) tells you the cluster number that...

ongeveer 3 uur ago | 0

Answered

How do I setup ROI once and it will apply to all other images?

imageFolder = dir('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\OK\*.jpg'); numfiles = length(imageFolder); ori_roi = cell...

How do I setup ROI once and it will apply to all other images?

imageFolder = dir('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\OK\*.jpg'); numfiles = length(imageFolder); ori_roi = cell...

ongeveer 3 uur ago | 0

Answered

Data import from csv file

These days we recommend readtable() -- or if you have R2019a or later and your data is entirely numeric, then possibly readmatri...

Data import from csv file

These days we recommend readtable() -- or if you have R2019a or later and your data is entirely numeric, then possibly readmatri...

ongeveer 5 uur ago | 0

Answered

solve a system of equations symbolically with R2018a

You are using R2018b or later. solve() no longer accepts character vectors for equations. Furthermore, each of your equations h...

solve a system of equations symbolically with R2018a

You are using R2018b or later. solve() no longer accepts character vectors for equations. Furthermore, each of your equations h...

ongeveer 5 uur ago | 0

Answered

Issue Saving image with text overlay to png

I recommend you take a different approach. Instead of plotting on the image and text() on the image, use the Computer Vision ins...

Issue Saving image with text overlay to png

I recommend you take a different approach. Instead of plotting on the image and text() on the image, use the Computer Vision ins...

ongeveer 5 uur ago | 0

Answered

How can I get the index numbers of cells that form a specific string?

This is an algorithm question rather than a MATLAB question, really. Start with an empty cell array of leading substrings, and ...

How can I get the index numbers of cells that form a specific string?

This is an algorithm question rather than a MATLAB question, really. Start with an empty cell array of leading substrings, and ...

ongeveer 5 uur ago | 0

Answered

convert from datetimes to double

datenum() the datetime object. This is not preferred. Consider using a table object or better yet a timetable

convert from datetimes to double

datenum() the datetime object. This is not preferred. Consider using a table object or better yet a timetable

ongeveer 6 uur ago | 0

Answered

M-script error while run it

You ask to sim() project3test . However if you look carefully at the first of your two images you will see that your real model ...

M-script error while run it

You ask to sim() project3test . However if you look carefully at the first of your two images you will see that your real model ...

ongeveer 6 uur ago | 0

Answered

Index exceeds the number of array elements (1).

You only assign to t(n) when n is 1, so t(1) exists but no other t location. You then increase n to 2 and expect t(2) to exist. ...

Index exceeds the number of array elements (1).

You only assign to t(n) when n is 1, so t(1) exists but no other t location. You then increase n to 2 and expect t(2) to exist. ...

ongeveer 7 uur ago | 1

Answered

dealing with negative indices error

for T = 1 t = -1:1 end After that T is the scalar 1 and t is -1 0 1 F = X_temp + (((delta*eta)/(beta*r))*(1-exp(r...

dealing with negative indices error

for T = 1 t = -1:1 end After that T is the scalar 1 and t is -1 0 1 F = X_temp + (((delta*eta)/(beta*r))*(1-exp(r...

ongeveer 7 uur ago | 0

Answered

Error using function. I get the error Array indices must be positive integers or logical values.

You have V(1,1) and you assign that to V_fun{1}. We do not know the datatype of V but we do know that indexing with () can never...

Error using function. I get the error Array indices must be positive integers or logical values.

You have V(1,1) and you assign that to V_fun{1}. We do not know the datatype of V but we do know that indexing with () can never...

ongeveer 8 uur ago | 0

| accepted

Answered

When reading an image, why is the map value blank?

This is common. RGB images are r x c x 3 with an empty map CMYK images (tiff only) are r x c x 4 with an empty map RGBA...

When reading an image, why is the map value blank?

This is common. RGB images are r x c x 3 with an empty map CMYK images (tiff only) are r x c x 4 with an empty map RGBA...

ongeveer 8 uur ago | 1

| accepted

Answered

how to generate a function using symbolic expression and plot that

Replace syms gamma With gamma = sym('gamma');

how to generate a function using symbolic expression and plot that

Replace syms gamma With gamma = sym('gamma');

ongeveer 9 uur ago | 0

| accepted

Answered

Getting out of while loop when user says end

With r2017a or later you can also use answer == "Yes"

Getting out of while loop when user says end

With r2017a or later you can also use answer == "Yes"

ongeveer 9 uur ago | 0

Answered

number format using solve

Why not? Those are the answers to the question you are asking of MATLAB. If you put them back through the equations, you will fi...

number format using solve

Why not? Those are the answers to the question you are asking of MATLAB. If you put them back through the equations, you will fi...

ongeveer 18 uur ago | 0

Answered

Finding the Probability of a Sequence of Numbers

A= [10 13 10 1 111 102 10 13 7 10 112 100 14 116 102 10 14 120]; Ac = A.'; ...

Finding the Probability of a Sequence of Numbers

A= [10 13 10 1 111 102 10 13 7 10 112 100 14 116 102 10 14 120]; Ac = A.'; ...

ongeveer 19 uur ago | 0

| accepted

Answered

Index exceeds the number of array elements (1). Caused by: Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.

constraint2 will be called with a vector the same size as the vector passed to the objective function. Your x0 in your fmincon c...

Index exceeds the number of array elements (1). Caused by: Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.

constraint2 will be called with a vector the same size as the vector passed to the objective function. Your x0 in your fmincon c...

ongeveer 19 uur ago | 0

| accepted

Answered

I get an error stating "Not enough input arguments. Error in constraint2 (line 3) c(1)=x(n+6)-x(n+7);". Please Help

constraint2 will be called with a vector the same size as the vector passed to the objective function. Your x0 in your fmincon c...

I get an error stating "Not enough input arguments. Error in constraint2 (line 3) c(1)=x(n+6)-x(n+7);". Please Help

constraint2 will be called with a vector the same size as the vector passed to the objective function. Your x0 in your fmincon c...

ongeveer 19 uur ago | 0

Answered

Index in position 1 exceeds array bounds (must not exceed 1).

Give the command dbstop if error and run the code. If the place it stops is not a try/catch or error() call, then you have fou...

Index in position 1 exceeds array bounds (must not exceed 1).

Give the command dbstop if error and run the code. If the place it stops is not a try/catch or error() call, then you have fou...

ongeveer 20 uur ago | 1

Answered

real and imaginary part of complex number

V = complex(randi([-10 10],1), randi([-10 10])); %some data to work on syms n real Vn = V^(1/n); RV = rewrite( real(Vn),...

real and imaginary part of complex number

V = complex(randi([-10 10],1), randi([-10 10])); %some data to work on syms n real Vn = V^(1/n); RV = rewrite( real(Vn),...

ongeveer 20 uur ago | 2

| accepted

Answered

Write Data to Excel

T = table(cellstr(var).', val.'); writetable(T, filename, 'Sheet', 1, 'Range', 'A1', 'writevariablenames', false)

Write Data to Excel

T = table(cellstr(var).', val.'); writetable(T, filename, 'Sheet', 1, 'Range', 'A1', 'writevariablenames', false)

ongeveer 21 uur ago | 0

Answered

Fraction in label of a scatter plot

h = gobjects(1,2); h(1) = scatter(Base(:,1), Base(:,2), 30, 'b', 's', 'LineWidth', 2, 'DisplayName',' $\frac{X}{Y}$'); hold ...

Fraction in label of a scatter plot

h = gobjects(1,2); h(1) = scatter(Base(:,1), Base(:,2), 30, 'b', 's', 'LineWidth', 2, 'DisplayName',' $\frac{X}{Y}$'); hold ...

ongeveer 21 uur ago | 0

| accepted

Answered

Warning: The DrawMode property will be removed in a future release. Use the SortMethod property instead. > In SixDofAnimation (line ...)

https://blogs.mathworks.com/graphics/2014/11/04/sortmethod/ https://www.mathworks.com/matlabcentral/answers/100094-what-determ...

Warning: The DrawMode property will be removed in a future release. Use the SortMethod property instead. > In SixDofAnimation (line ...)

https://blogs.mathworks.com/graphics/2014/11/04/sortmethod/ https://www.mathworks.com/matlabcentral/answers/100094-what-determ...

ongeveer 21 uur ago | 1

| accepted

Answered

What are the system requirements for MATLAB Runtime?

The system requirements for MATLAB Runtime (for use with an executable created with MATLAB Compiler or MATLAB Compiler SDK) are ...

What are the system requirements for MATLAB Runtime?

The system requirements for MATLAB Runtime (for use with an executable created with MATLAB Compiler or MATLAB Compiler SDK) are ...

ongeveer 21 uur ago | 0

| accepted

Answered

gray2rgb conversion

When you allocated memory for the rgb array, you used something like, [rows, cols] = size(Image); rgb = zeros(rows, cols, 3); ...

gray2rgb conversion

When you allocated memory for the rgb array, you used something like, [rows, cols] = size(Image); rgb = zeros(rows, cols, 3); ...

ongeveer 21 uur ago | 0

Answered

why the subtraction gives the wrong ans.?

double(y) - double(Z) You could also get away with int32(y) - int32(Z) However, int16(y) - int16(Z) will not work reliably: i...

why the subtraction gives the wrong ans.?

double(y) - double(Z) You could also get away with int32(y) - int32(Z) However, int16(y) - int16(Z) will not work reliably: i...

ongeveer 21 uur ago | 0

Answered

how to divide a 3D figure in matlab in to cubes and getting the cubes's addresses

% Step 1: Open the regions of interest file B= dicominfo('C:\Users\mij\Music\RS.1.3.6.1.4.1.2452.6.3144839235.1145246484.216557...

how to divide a 3D figure in matlab in to cubes and getting the cubes's addresses

% Step 1: Open the regions of interest file B= dicominfo('C:\Users\mij\Music\RS.1.3.6.1.4.1.2452.6.3144839235.1145246484.216557...

ongeveer 22 uur ago | 0

Answered

GUI help in calling an if elseif else function

Use the Callback property of the edit box to trigger the action. Remember that the edit box will be char (or cell array of char ...

GUI help in calling an if elseif else function

Use the Callback property of the edit box to trigger the action. Remember that the edit box will be char (or cell array of char ...

1 dag ago | 0

Answered

Artificial bee colony algorithm

https://www.mathworks.com/matlabcentral/fileexchange/50873-ant-colony-optimization-for-pid-controller-of-a-dc-motor https://www...

Artificial bee colony algorithm

https://www.mathworks.com/matlabcentral/fileexchange/50873-ant-colony-optimization-for-pid-controller-of-a-dc-motor https://www...

1 dag ago | 0

Answered

Can I import data into a table where the columns become variables?

You could use tableread() to read the data, but you would want to tell it to skip the three lines at top, and you would have to ...

Can I import data into a table where the columns become variables?

You could use tableread() to read the data, but you would want to tell it to skip the three lines at top, and you would have to ...

1 dag ago | 2

| accepted