5,364 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 to set elements of a matrix to 0 from one index to the remaining of the row ?

[I,J,S]=find(X); keep=(J<Column_Index(I)); X=sparse(I(keep), J(keep), S(keep) ,m,n);

How to set elements of a matrix to 0 from one index to the remaining of the row ?

[I,J,S]=find(X); keep=(J<Column_Index(I)); X=sparse(I(keep), J(keep), S(keep) ,m,n);

21 hours ago | 1

| accepted

Answered

Using scatteredInterpolant for 1-D data

These FEX files look applicable (and popular): https://www.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections ...

Using scatteredInterpolant for 1-D data

These FEX files look applicable (and popular): https://www.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections ...

23 hours ago | 0

Answered

fft definition in matlab doc puzzling

Given that the fft results in both positive and negative frequencies, I woumld have guess a defintion like : Perhaps a better w...

fft definition in matlab doc puzzling

Given that the fft results in both positive and negative frequencies, I woumld have guess a defintion like : Perhaps a better w...

1 day ago | 0

| accepted

Answered

Can I avoid this broadcast variable?

Why not this? parfor k = 1:size(S,2) tmp=S(:,k); for j = 1:length(b) fun(tmp,b(j)); end end

Can I avoid this broadcast variable?

Why not this? parfor k = 1:size(S,2) tmp=S(:,k); for j = 1:length(b) fun(tmp,b(j)); end end

1 day ago | 0

| accepted

Answered

how can I transform this code into a for loop

a=[0.1, 0.3, 0.6, 1.3, 1.6, 1.9, 2.2, 2.5, 2.8]; b=a+0.25; for i=1:9 subplot(3,3,i); [S,f]=myFFT( x...

how can I transform this code into a for loop

a=[0.1, 0.3, 0.6, 1.3, 1.6, 1.9, 2.2, 2.5, 2.8]; b=a+0.25; for i=1:9 subplot(3,3,i); [S,f]=myFFT( x...

2 days ago | 0

Answered

Find the index of the elements that are between two radii

Perhaps this is what you want? G=discretize(Final_r,initial_r); Indices = accumarray(G.',(1:numel(Final_r)).',[],@(z) {so...

Find the index of the elements that are between two radii

Perhaps this is what you want? G=discretize(Final_r,initial_r); Indices = accumarray(G.',(1:numel(Final_r)).',[],@(z) {so...

2 days ago | 0

| accepted

Answered

Find clusters with specific value in 3D matrix

S=regionprops(yourImage<0.05,'Area','PixelIdxList'); S=S([S.Area]>=30); %edited result=zeros(size(yourImage)); for i=1:nu...

Find clusters with specific value in 3D matrix

S=regionprops(yourImage<0.05,'Area','PixelIdxList'); S=S([S.Area]>=30); %edited result=zeros(size(yourImage)); for i=1:nu...

2 days ago | 1

| accepted

Answered

Find the index of the elements that are between two radii

index = (Final_r>=initial_r) & (Final_r<[initial_r(2:end),inf])

Find the index of the elements that are between two radii

index = (Final_r>=initial_r) & (Final_r<[initial_r(2:end),inf])

2 days ago | 0

Answered

non overlapping random circles

Perhaps one of these FEX contributions would be helpful.

non overlapping random circles

Perhaps one of these FEX contributions would be helpful.

3 days ago | 0

Answered

Undefined function or variable 'drawellipse'

drawellipse wasn't introduced until R2018b.

Undefined function or variable 'drawellipse'

drawellipse wasn't introduced until R2018b.

3 days ago | 1

| accepted

Answered

Product of elements in an array

For example, >> x=[3 5 7 11]; >> prod(nchoosek(x,3),2) ans = 105 165 231 385

Product of elements in an array

For example, >> x=[3 5 7 11]; >> prod(nchoosek(x,3),2) ans = 105 165 231 385

3 days ago | 0

Answered

How to find the coordinates of the white square ?

Some simple morphological operations are all you need. A=imbinarize((imread('image.jpeg'))); A=bwareafilt( imopen(A,strel...

How to find the coordinates of the white square ?

Some simple morphological operations are all you need. A=imbinarize((imread('image.jpeg'))); A=bwareafilt( imopen(A,strel...

3 days ago | 0

| accepted

Answered

Calculating dot product of 2 3 dimensional row vectors

I think this is what you want: x=input('Enter the 1st pair of 3 vector elements in [square brackets]: '); if (numel(x)~=3); ...

Calculating dot product of 2 3 dimensional row vectors

I think this is what you want: x=input('Enter the 1st pair of 3 vector elements in [square brackets]: '); if (numel(x)~=3); ...

3 days ago | 0

| accepted

Answered

issorted alternative for optimization toolbox

You can do, prob.Constraints.sorted = ( A(2:end) <= A(1:end-1) );

issorted alternative for optimization toolbox

You can do, prob.Constraints.sorted = ( A(2:end) <= A(1:end-1) );

3 days ago | 0

Answered

The "fslove function" got different answer on two computers

Have you checked whether both results are valid solutions to the equations? If a continuum of solutions exists, it is quite conc...

The "fslove function" got different answer on two computers

Have you checked whether both results are valid solutions to the equations? If a continuum of solutions exists, it is quite conc...

3 days ago | 1

| accepted

Answered

fft definition in matlab doc puzzling

Your second definition only makes sense if you define the indexing in Y(k) to be modulo-n. Otherwise, it is not clear what it me...

fft definition in matlab doc puzzling

Your second definition only makes sense if you define the indexing in Y(k) to be modulo-n. Otherwise, it is not clear what it me...

4 days ago | 0

Answered

How to fix this error in interpolation?

interp1 is complaining that y3 has repeated elements. They are required to be unique and monotonic.

How to fix this error in interpolation?

interp1 is complaining that y3 has repeated elements. They are required to be unique and monotonic.

4 days ago | 0

Answered

How to sum multiple matrice in loop ?

Is this what you want? result = squeeze(sum(T3,3)); If not please clarify what the dimensions of the final result should be.

How to sum multiple matrice in loop ?

Is this what you want? result = squeeze(sum(T3,3)); If not please clarify what the dimensions of the final result should be.

4 days ago | 0

Answered

Imprecision problem: pinv(H) is not equal to pinv(H'*H)*H'

Seems to me the obvious solution is not to push gamma to infinity. That removes the regularization whose purpose is precisely to...

Imprecision problem: pinv(H) is not equal to pinv(H'*H)*H'

Seems to me the obvious solution is not to push gamma to infinity. That removes the regularization whose purpose is precisely to...

4 days ago | 0

Answered

Using other solvers for models generated by optimproblem

You can use prob2struct to help convert a problem-based description of the linear constraints to the matrices required by other ...

Using other solvers for models generated by optimproblem

You can use prob2struct to help convert a problem-based description of the linear constraints to the matrices required by other ...

5 days ago | 2

| accepted

Answered

Plotting shapes based on equations and weights.

For 2D and 3D functions, you can use fimplict and fimplicit3, e.g., fimplicit(@(x,y) w0+w1*x+w2*y)

Plotting shapes based on equations and weights.

For 2D and 3D functions, you can use fimplict and fimplicit3, e.g., fimplicit(@(x,y) w0+w1*x+w2*y)

5 days ago | 0

Answered

What is the equivalent of the function 'wait' after using 'imellipse' for the new function 'drawcircle' (version R2018b)?

Here's a (ch)easy workaround using the waitfordoubleclick.m file attached drawcircle; waitfordoubleclick You may have to adjus...

What is the equivalent of the function 'wait' after using 'imellipse' for the new function 'drawcircle' (version R2018b)?

Here's a (ch)easy workaround using the waitfordoubleclick.m file attached drawcircle; waitfordoubleclick You may have to adjus...

5 days ago | 0

| accepted

Answered

Multiple regression with multiple variations

e=ones(size(x1)); abcdef = y/[e;x2;x3;1./x1;x2./x1;x3./x1] abcdef = 6.3301 0.0113 -0.0117 88.7676 -0.8784...

Multiple regression with multiple variations

e=ones(size(x1)); abcdef = y/[e;x2;x3;1./x1;x2./x1;x3./x1] abcdef = 6.3301 0.0113 -0.0117 88.7676 -0.8784...

7 days ago | 0

| accepted

Answered

assigning a variable to an output of a function at a certain time

t=1; yone=yourFunction(t);

assigning a variable to an output of a function at a certain time

t=1; yone=yourFunction(t);

7 days ago | 0

Answered

Linear and Non-Linear constraint Optimization

Yes, c and ceq can be vectors (or matrices, or arrays of any dimension...).

Linear and Non-Linear constraint Optimization

Yes, c and ceq can be vectors (or matrices, or arrays of any dimension...).

7 days ago | 0

| accepted

Answered

Specifying some but not all Nonlinear Constraint Gradients through Fmincon

I agree, it would be nice if the Optimization Toolbox would expose its finite differencing code as a separate function, so that ...

Specifying some but not all Nonlinear Constraint Gradients through Fmincon

I agree, it would be nice if the Optimization Toolbox would expose its finite differencing code as a separate function, so that ...

8 days ago | 0

| accepted

Answered

innerjoin invalid parameter name

It appears that you are attempting to do the following: Akeys={'DateAnnounced','TargetName','AcquirorName'}; Bkeys={'DateAnnou...

innerjoin invalid parameter name

It appears that you are attempting to do the following: Akeys={'DateAnnounced','TargetName','AcquirorName'}; Bkeys={'DateAnnou...

8 days ago | 0

| accepted

Answered

How to Show 1/4 in 1/2^2?

You can also create symbolic numbers sym(1/3) 1/3 but be mindful that all calculations you do with such numbers will also giv...

How to Show 1/4 in 1/2^2?

You can also create symbolic numbers sym(1/3) 1/3 but be mindful that all calculations you do with such numbers will also giv...

8 days ago | 1