6.203 total contributions since 2009

Professional Interests: medical image processing, optimization algorithms

PLEASE NOTE: I do not read email sent through my author page. Please post questions about FEX submissions in their respective Comments section.

Answered

How calculate the second and third numerical derivative of one variable f(x)

Matlab's diff command will do this directly, https://www.mathworks.com/help/matlab/ref/diff.html

How calculate the second and third numerical derivative of one variable f(x)

Matlab's diff command will do this directly, https://www.mathworks.com/help/matlab/ref/diff.html

3 días ago | 0

Answered

Creating an optimization constraint - how to only schedule one employee per time slot

The problem-based optimization workflow is especially handy for matrix-valued optimization variables. It lets you write constrai...

Creating an optimization constraint - how to only schedule one employee per time slot

The problem-based optimization workflow is especially handy for matrix-valued optimization variables. It lets you write constrai...

3 días ago | 1

Answered

Using a for loop, how can I multiply diagonal elements of a matrix NxN?

product = product*B(column,column) ;

Using a for loop, how can I multiply diagonal elements of a matrix NxN?

product = product*B(column,column) ;

3 días ago | 0

| accepted

Answered

Single precision matrix multiplication

The Matlab interpreter runs a special dedicated "ctranspose-multiply" function to evaluate expressions of the form, P'*Q It do...

Single precision matrix multiplication

The Matlab interpreter runs a special dedicated "ctranspose-multiply" function to evaluate expressions of the form, P'*Q It do...

4 días ago | 1

| accepted

Answered

Non linear fitting with constraints

You would have to use fmincon, which will let you specify non-linear constraints.

Non linear fitting with constraints

You would have to use fmincon, which will let you specify non-linear constraints.

4 días ago | 0

| accepted

Answered

imwrite does not save file in specified folder :(

Try this, dest=fullfile(newpath, ['new_' file(k).name(1:end-4) '.jpeg']); imwrite(I,dest);

imwrite does not save file in specified folder :(

Try this, dest=fullfile(newpath, ['new_' file(k).name(1:end-4) '.jpeg']); imwrite(I,dest);

4 días ago | 0

| accepted

Answered

Using lsqcurvefit in a Matlab App

Here is a snippet of the code I am working with. No, the code should look like this, methods (Access = private) %...

Using lsqcurvefit in a Matlab App

Here is a snippet of the code I am working with. No, the code should look like this, methods (Access = private) %...

5 días ago | 0

| accepted

Answered

Fit sum parameters of an overdetermined system

Your xdata should be a 9x11 matrix, your ydata should be a 1x11 vector, and the code for your function should look like this, f...

Fit sum parameters of an overdetermined system

Your xdata should be a 9x11 matrix, your ydata should be a 1x11 vector, and the code for your function should look like this, f...

5 días ago | 0

| accepted

Answered

Not (~) operation of binary image after subtracting double data type of binary images. Could I have the explaination of this?

If im1 and im2 start off as uint8, then subtraction operations 0-1 will yield zero values, >> uint8(0)-uint8(1) ans = u...

Not (~) operation of binary image after subtracting double data type of binary images. Could I have the explaination of this?

If im1 and im2 start off as uint8, then subtraction operations 0-1 will yield zero values, >> uint8(0)-uint8(1) ans = u...

5 días ago | 1

| accepted

Answered

How to separate a variable out of trigonomic expression

These identities may help,

How to separate a variable out of trigonomic expression

These identities may help,

5 días ago | 1

Answered

Unable to perform assignment because the left and right sides have a different number of elements error

It's because in that line, b is not a scalar, even though everything else is:

Unable to perform assignment because the left and right sides have a different number of elements error

It's because in that line, b is not a scalar, even though everything else is:

5 días ago | 0

Answered

Does anyone know the process of solving this problem?: "Write a MATLAB command to plot 5 cycles of s=sin(1000t)."

This very similar example may be of some help, https://www.mathworks.com/help/matlab/ref/plot.html#btzitot-4

Does anyone know the process of solving this problem?: "Write a MATLAB command to plot 5 cycles of s=sin(1000t)."

This very similar example may be of some help, https://www.mathworks.com/help/matlab/ref/plot.html#btzitot-4

6 días ago | 1

| accepted

Answered

least square circle, why doesn't it work?

As I mentioned in your other post, your approach is not a good way to fit a circle. However, assuming you must do it this way, y...

least square circle, why doesn't it work?

As I mentioned in your other post, your approach is not a good way to fit a circle. However, assuming you must do it this way, y...

6 días ago | 1

| accepted

Answered

Non linear least square fitting

Ok. Could you possibly show me the analytical alternatives to Adam's solution? See attached. Note that my method does not mini...

Non linear least square fitting

Ok. Could you possibly show me the analytical alternatives to Adam's solution? See attached. Note that my method does not mini...

7 días ago | 2

Answered

How can I use graph object info to find: areas, number of sides, and perimeter lengths of a each connected polygon within a network of polygons?

Using one of my recent FEX postings, https://www.mathworks.com/matlabcentral/fileexchange/73630-spatialgraph2d you should be a...

How can I use graph object info to find: areas, number of sides, and perimeter lengths of a each connected polygon within a network of polygons?

Using one of my recent FEX postings, https://www.mathworks.com/matlabcentral/fileexchange/73630-spatialgraph2d you should be a...

7 días ago | 0

| accepted

Submitted

spatialgraph2D

Creates a graph object with 2D spatial locations associated with the nodes

7 días ago | 12 downloads |

Answered

return the numerator and denimentor

If x is a symbolic variable, then yes >> x=sym(1/2); >> [n,d]=numden(x) n = 1 d = 2

return the numerator and denimentor

If x is a symbolic variable, then yes >> x=sym(1/2); >> [n,d]=numden(x) n = 1 d = 2

7 días ago | 0

Answered

vectorize high dimensional image

result = reshape(yourImage,[],102).';

vectorize high dimensional image

result = reshape(yourImage,[],102).';

7 días ago | 0

| accepted

Answered

How to replace elements of a matrix with the scaled identity?

B=kron(A,eye(n))

How to replace elements of a matrix with the scaled identity?

B=kron(A,eye(n))

7 días ago | 1

| accepted

Answered

How to move indexed files say file_1, file_2, file_3 to indexed folder_1, folder_2, folder 3. I am using for loop to create these folders and files in an indexed and automatic manner.....but how to move these files into these folders...Plz help

>> Files="file_"+(1:5) Files = 1×5 string array "file_1" "file_2" "file_3" "file_4" "file_5" >> F...

How to move indexed files say file_1, file_2, file_3 to indexed folder_1, folder_2, folder 3. I am using for loop to create these folders and files in an indexed and automatic manner.....but how to move these files into these folders...Plz help

>> Files="file_"+(1:5) Files = 1×5 string array "file_1" "file_2" "file_3" "file_4" "file_5" >> F...

8 días ago | 1

| accepted

Answered

Find an optimal solution for a system with matrix

f=-A(:); Aineq=[B(:),C(:)].'; bineq=[4;3] Xoptimal=linprog(f,Aineq,bineq)

Find an optimal solution for a system with matrix

f=-A(:); Aineq=[B(:),C(:)].'; bineq=[4;3] Xoptimal=linprog(f,Aineq,bineq)

8 días ago | 0

Answered

Trying to plot Eulers, but keep getting straight line

You're getting a straight line because the right hand side of this line acmi(1:10001)=-a+(alpha(n)*l*cos(theta(n)))-((omega(n)^...

Trying to plot Eulers, but keep getting straight line

You're getting a straight line because the right hand side of this line acmi(1:10001)=-a+(alpha(n)*l*cos(theta(n)))-((omega(n)^...

9 días ago | 0

Answered

how to write a function for quadratic equation

[x1,x2] = QuadraticEquation (1,-2,0) function [x1,x2] = QuadraticEquation (a,b,c) d=b^2-4*a*c; if d>=0 disp ('...

how to write a function for quadratic equation

[x1,x2] = QuadraticEquation (1,-2,0) function [x1,x2] = QuadraticEquation (a,b,c) d=b^2-4*a*c; if d>=0 disp ('...

9 días ago | 0

| accepted

Answered

multi-variable optimization in matlab?

Many other variables are to be calculated first, which are actually functions of the first two variables, and then they're used ...

multi-variable optimization in matlab?

Many other variables are to be calculated first, which are actually functions of the first two variables, and then they're used ...

9 días ago | 0

| accepted

Answered

Call a function in a sub directory?

The only way, I believe, is to visit each folder and create a function handle to each respective version of sayhi(), cd folder1...

Call a function in a sub directory?

The only way, I believe, is to visit each folder and create a function handle to each respective version of sayhi(), cd folder1...

9 días ago | 0

Answered

Map a 2D matrix into 3D using loop for allotment along the 3rd dimension

You could try this. clear data_trialwise for i=20:-1:1 data_trialwise(:,:,i)=data(:,begin(i):end(i)); % begin and end bot...

Map a 2D matrix into 3D using loop for allotment along the 3rd dimension

You could try this. clear data_trialwise for i=20:-1:1 data_trialwise(:,:,i)=data(:,begin(i):end(i)); % begin and end bot...

10 días ago | 0

Answered

shifted triangular matrix array

ac=num2cell([0,0;a],2); T=toeplitz(1:4,[1,zeros(1,3)]); A=cell2mat(ac(T+1)) A = 1 2 0 0 0 ...

shifted triangular matrix array

ac=num2cell([0,0;a],2); T=toeplitz(1:4,[1,zeros(1,3)]); A=cell2mat(ac(T+1)) A = 1 2 0 0 0 ...

10 días ago | 1

| accepted