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

Find values that put equation to zero

gamma=nan(T,1); j=1; %increment level. The loop will work for j>1 as well. for i=1:j:T; ci=C(i); si=S(i); mi=M(i); ...

Find values that put equation to zero

gamma=nan(T,1); j=1; %increment level. The loop will work for j>1 as well. for i=1:j:T; ci=C(i); si=S(i); mi=M(i); ...

12 hours ago | 0

| accepted

Answered

Fzero question : Error using fzero (line 308) Initial function value must be finite and real.

Well you have divisions by x in your function, so naturally choosing x0=0 will not give you a finite initial value. Also, you a...

Fzero question : Error using fzero (line 308) Initial function value must be finite and real.

Well you have divisions by x in your function, so naturally choosing x0=0 will not give you a finite initial value. Also, you a...

14 hours ago | 0

| accepted

Answered

find the object closest to the center

I found it highly challenging to close the blobs surgically enough so that the two lungs and the bed are always guaranteed to fo...

find the object closest to the center

I found it highly challenging to close the blobs surgically enough so that the two lungs and the bed are always guaranteed to fo...

1 day ago | 1

Answered

How to implement triple summation?

Well, for each fixed p and q, the inner sum over m is just a discrete convolution. So, perhaps the best solution is to do a doub...

How to implement triple summation?

Well, for each fixed p and q, the inner sum over m is just a discrete convolution. So, perhaps the best solution is to do a doub...

1 day ago | 0

Answered

how to use binary morphological operations for corner detection

I don't think you can, but if the shape is convex, you can use this FEX tool instead, https://www.mathworks.com/matlabcentral/f...

how to use binary morphological operations for corner detection

I don't think you can, but if the shape is convex, you can use this FEX tool instead, https://www.mathworks.com/matlabcentral/f...

1 day ago | 1

Answered

How to calculate the camera intrinsics K , rotation matrix R and translation vector T through the camera projection matrix?

For various randomized input matrices, it gives the same output (within numerical precision) as my own decomposition routine (at...

How to calculate the camera intrinsics K , rotation matrix R and translation vector T through the camera projection matrix?

For various randomized input matrices, it gives the same output (within numerical precision) as my own decomposition routine (at...

1 day ago | 0

| accepted

Answered

How to decompose the "camera projection matrix" into camera internal and external parameters?

If you have the 3x4 camera projection matrix already, then it can be directly decomposed into intrinsics and extrinsics. The att...

How to decompose the "camera projection matrix" into camera internal and external parameters?

If you have the 3x4 camera projection matrix already, then it can be directly decomposed into intrinsics and extrinsics. The att...

1 day ago | 0

| accepted

Answered

How do I find the line representing the intersection of two planes?

HINT: You can get the normals to the planes using cross() % Plane 1 A = [1 1 1]; B = [2 -3 5]; C = [-7 2 1]; % Plane 2 D =...

How do I find the line representing the intersection of two planes?

HINT: You can get the normals to the planes using cross() % Plane 1 A = [1 1 1]; B = [2 -3 5]; C = [-7 2 1]; % Plane 2 D =...

1 day ago | 0

| accepted

Answered

Using matfile to partially extra data still loads entire file into memory

We can run a test right here. The one below suggests there is some benefit, though perhaps not as much benefit as I would have e...

Using matfile to partially extra data still loads entire file into memory

We can run a test right here. The one below suggests there is some benefit, though perhaps not as much benefit as I would have e...

2 days ago | 0

Answered

How can I find the eigenvalues of an n-by-n matrix using For Loops?

What I do have available to me is a previous code I wrote that would solve any n x n matrix using Gauss-Jordan elimination but t...

How can I find the eigenvalues of an n-by-n matrix using For Loops?

What I do have available to me is a previous code I wrote that would solve any n x n matrix using Gauss-Jordan elimination but t...

2 days ago | 0

Answered

changing variable names when saving variables

What I want is that, when I open the variables I want it to call them a different name for every subscript. Now the variable is ...

changing variable names when saving variables

What I want is that, when I open the variables I want it to call them a different name for every subscript. Now the variable is ...

2 days ago | 0

Answered

Mean, Max and Min of Structured Cell array

You should first convert everything to table form. Column3={{'dog';'dog';'dog'},{'cat';'cat'}}; %Original data Column4={[1;2;...

Mean, Max and Min of Structured Cell array

You should first convert everything to table form. Column3={{'dog';'dog';'dog'},{'cat';'cat'}}; %Original data Column4={[1;2;...

2 days ago | 1

| accepted

Answered

Is it possible to write methods that iteratively process each element of an objectarray without writing for-loops each time?

It is not possible in a get.property() method, but it is possible in a normal method. function meanValues = mean(Objects) ...

Is it possible to write methods that iteratively process each element of an objectarray without writing for-loops each time?

It is not possible in a get.property() method, but it is possible in a normal method. function meanValues = mean(Objects) ...

2 days ago | 0

| accepted

Answered

Sum of a portion of 3D matrix elements

[I,J,K]=ndgrid(1:N); total = sum(A(I<=J & J<=K))

Sum of a portion of 3D matrix elements

[I,J,K]=ndgrid(1:N); total = sum(A(I<=J & J<=K))

2 days ago | 0

| accepted

Answered

'drawcircle' and 'roi.cricle' do not respect preset Radius

I think you need to specify the center coordinate as well.

'drawcircle' and 'roi.cricle' do not respect preset Radius

I think you need to specify the center coordinate as well.

2 days ago | 0

Answered

How do I delete slices in 3D-Array?

Saravanan Sengottuvel's answer moved here: Generating an example 3D array that has 10 slices A = repmat([0 0 0 0; 1 0 0 0; 1 0...

How do I delete slices in 3D-Array?

Saravanan Sengottuvel's answer moved here: Generating an example 3D array that has 10 slices A = repmat([0 0 0 0; 1 0 0 0; 1 0...

2 days ago | 0

| accepted

Answered

Calculating a matrix with a specific form

Another solution, using func2mat (Download). N=size(x,2); C=func2mat( @(m)cross(repelem(m,1,N),x) , ones(3,1) , 'doSparse',0...

Calculating a matrix with a specific form

Another solution, using func2mat (Download). N=size(x,2); C=func2mat( @(m)cross(repelem(m,1,N),x) , ones(3,1) , 'doSparse',0...

3 days ago | 0

Answered

Simultaneously interpolating over multiple rows of a matrix.

This might be better, e=1:K; F=griddedInterpolant(mat(ind1,:),{e,grid}); vals_temp = F(e,qvec);

Simultaneously interpolating over multiple rows of a matrix.

This might be better, e=1:K; F=griddedInterpolant(mat(ind1,:),{e,grid}); vals_temp = F(e,qvec);

3 days ago | 0

| accepted

Answered

Simultaneously interpolating over multiple rows of a matrix.

V=mat.'; vals_temp = interp1(grid,V(:,ind1),qvec);

Simultaneously interpolating over multiple rows of a matrix.

V=mat.'; vals_temp = interp1(grid,V(:,ind1),qvec);

3 days ago | 0

Answered

How to find the first number, ignore subsequent until a greater number repeats.

Is this what you want? A = [ 0 3 0 3 0 3 0 3 0 4 0 4 0 4 0 4 0 5 0 5 0 5 0 5 0 5 0 3 0 3 0 3]; cA=cummax(A); b1=find(A==3...

How to find the first number, ignore subsequent until a greater number repeats.

Is this what you want? A = [ 0 3 0 3 0 3 0 3 0 4 0 4 0 4 0 4 0 5 0 5 0 5 0 5 0 5 0 3 0 3 0 3]; cA=cummax(A); b1=find(A==3...

3 days ago | 1

Answered

Removing lines in matrix

Hint: do something with this line: ind = any( A==0 | abs(A)==10 ,2)

Removing lines in matrix

Hint: do something with this line: ind = any( A==0 | abs(A)==10 ,2)

4 days ago | 1

Answered

Matlab clears persistent and global variables in fmincon when activating UseParallel

This happens because, in parallel computing, it isn't easily definable what it means for a variable to "persist". A peristent va...

Matlab clears persistent and global variables in fmincon when activating UseParallel

This happens because, in parallel computing, it isn't easily definable what it means for a variable to "persist". A peristent va...

4 days ago | 2

| accepted

Answered

How to add a legend to all open figures?

For example, %% Open several figures with subplots for i=1:2 figure(i) for j=1:2 subplot(2,1,j) ...

How to add a legend to all open figures?

For example, %% Open several figures with subplots for i=1:2 figure(i) for j=1:2 subplot(2,1,j) ...

4 days ago | 0

| accepted

Answered

How can i plot multiple objects in same 3D space i.e. plot3 ?

Using hold on and hold off, you can add anything you want to a pre-existing 3D axis, even the results of a 2D plotting command. ...

How can i plot multiple objects in same 3D space i.e. plot3 ?

Using hold on and hold off, you can add anything you want to a pre-existing 3D axis, even the results of a 2D plotting command. ...

4 days ago | 0

Answered

How to use fmincon with vectors? (error message: not enough input arguments)

fun = @(x) -100*(x(1,:)-x(2,:).^2).^2 + (test-x(1,:)).^2;

How to use fmincon with vectors? (error message: not enough input arguments)

fun = @(x) -100*(x(1,:)-x(2,:).^2).^2 + (test-x(1,:)).^2;

5 days ago | 0

| accepted

Answered

Hessian output using simulannealbnd and fmincon

I'm assuming you can't simply do an analytical Hessian computation at the solution you found... One alternative would be to run...

Hessian output using simulannealbnd and fmincon

I'm assuming you can't simply do an analytical Hessian computation at the solution you found... One alternative would be to run...

5 days ago | 0

Answered

fsolve with multiple tolerance levels

You can use fmincon (instead of fsolve) to formulate the tolerances as nonlinear inequality constraints. Or you can use lsqnonli...

fsolve with multiple tolerance levels

You can use fmincon (instead of fsolve) to formulate the tolerances as nonlinear inequality constraints. Or you can use lsqnonli...

5 days ago | 0

Answered

Elliptical trajectory and plot waypoints for robotic arm simulation

Fairly easy to do with this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-fo...

Elliptical trajectory and plot waypoints for robotic arm simulation

Fairly easy to do with this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-fo...

5 days ago | 0

Answered

Creating random non-discrete values and assigning weights

As an example, weightList=[0.4 , 0.1, 0.3, 0.2]; x=rand(1,6)*40, Weights = weightList(discretize(x,0:10:40))

Creating random non-discrete values and assigning weights

As an example, weightList=[0.4 , 0.1, 0.3, 0.2]; x=rand(1,6)*40, Weights = weightList(discretize(x,0:10:40))

5 days ago | 0