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

Why matlab live editor and matlab script gives different rank calculation result for the same matrix ?

Probably because you copy-pasted the values of M from the screen to one of the scripts.

Why matlab live editor and matlab script gives different rank calculation result for the same matrix ?

Probably because you copy-pasted the values of M from the screen to one of the scripts.

20 hours ago | 0

| accepted

Answered

How to rotate 3D cube so that one face is normal to a given axis

If I can choose the missing rotation angle freely, then here is one solution. % Centre of system coords_source_xyz= [-0.5,...

How to rotate 3D cube so that one face is normal to a given axis

If I can choose the missing rotation angle freely, then here is one solution. % Centre of system coords_source_xyz= [-0.5,...

21 hours ago | 0

| accepted

Answered

Fitting Data from a matrix to polynomial

A very relevant example: https://www.mathworks.com/help/curvefit/fit.html#bto_zh5-3

Fitting Data from a matrix to polynomial

A very relevant example: https://www.mathworks.com/help/curvefit/fit.html#bto_zh5-3

1 day ago | 0

Answered

How to solve a nonlinear equation?

[x,fval] = fzero( @(x) x^(8.5)+3*x.^2-3000,nthroot(3000,8.5))

How to solve a nonlinear equation?

[x,fval] = fzero( @(x) x^(8.5)+3*x.^2-3000,nthroot(3000,8.5))

1 day ago | 0

Answered

fsolve function give poor results for multiple equations

Your equations are linear, so there is no reason to be using fsolve. I was able to obtain the coefficient matrix A for your line...

fsolve function give poor results for multiple equations

Your equations are linear, so there is no reason to be using fsolve. I was able to obtain the coefficient matrix A for your line...

1 day ago | 0

| accepted

Answered

Why do I only have an output of zeros for the 1 X 800

We cannot run your code, but a good debugging strategy would be to pause execution at this line, Kr_eff = ((1./mso).*sum(S.*(Ks...

Why do I only have an output of zeros for the 1 X 800

We cannot run your code, but a good debugging strategy would be to pause execution at this line, Kr_eff = ((1./mso).*sum(S.*(Ks...

1 day ago | 1

Answered

Nonlinear inequality in GA optimization with integer constraints

In the code you have shown for POWER_CONSTRAINT(~), it does not make sense that POWER does not depend on the input, but rather o...

Nonlinear inequality in GA optimization with integer constraints

In the code you have shown for POWER_CONSTRAINT(~), it does not make sense that POWER does not depend on the input, but rather o...

1 day ago | 0

Answered

I know how to divide my 256x256 image into 16x16 blocks using mat2cell. Now I want to access those 16x16 blocks successively to further divide them into 4x4 blocks.

Using mat2tiles https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

I know how to divide my 256x256 image into 16x16 blocks using mat2cell. Now I want to access those 16x16 blocks successively to further divide them into 4x4 blocks.

Using mat2tiles https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

1 day ago | 0

Answered

Generate a 100000x100000 matrix that takes less time and memory

Seems to me the whole code can be replaced by, function [a,ed] = Random_graph_genar_function(nodes, connectivity) a=logi...

Generate a 100000x100000 matrix that takes less time and memory

Seems to me the whole code can be replaced by, function [a,ed] = Random_graph_genar_function(nodes, connectivity) a=logi...

2 days ago | 0

| accepted

Answered

Randomized Groups of Array

Ex. I have 250 numbers and I want them in 50 groups of 5 reshape( randperm(250) , 5,50) or 25 groups of 10, reshape( randpe...

Randomized Groups of Array

Ex. I have 250 numbers and I want them in 50 groups of 5 reshape( randperm(250) , 5,50) or 25 groups of 10, reshape( randpe...

2 days ago | 0

Answered

How to solve explicit equation of ellipse

If you convert the ellipse to its polar representation https://en.wikipedia.org/wiki/Ellipse#Polar_form_relative_to_center tha...

How to solve explicit equation of ellipse

If you convert the ellipse to its polar representation https://en.wikipedia.org/wiki/Ellipse#Polar_form_relative_to_center tha...

2 days ago | 1

Answered

How to find the solutions to a set of linear equations?

You can easily trap the point where NaNs are introduced using >>dbstop if naninf https://www.mathworks.com/help/matlab/ref/dbs...

How to find the solutions to a set of linear equations?

You can easily trap the point where NaNs are introduced using >>dbstop if naninf https://www.mathworks.com/help/matlab/ref/dbs...

3 days ago | 0

Answered

Efficient number occurence count

In this situation, accumarray will be faster than histcounts, but still not as fast as the for-loop, tic; hc=accumarray(num(:)...

Efficient number occurence count

In this situation, accumarray will be faster than histcounts, but still not as fast as the for-loop, tic; hc=accumarray(num(:)...

3 days ago | 1

| accepted

Answered

Registation of two images in '.mat' format

With monomodal registration, it works fine for me, [optimizer, metric] = imregconfig('monomodal'); but I should mention that t...

Registation of two images in '.mat' format

With monomodal registration, it works fine for me, [optimizer, metric] = imregconfig('monomodal'); but I should mention that t...

3 days ago | 0

| accepted

Answered

construct a two level optimisation problem has fmincon solver for lower level and genetic algorithm for upper level

You are passing a variable called xl to LLConstraint(), but xl is not used anywhere within that function. The function is theref...

construct a two level optimisation problem has fmincon solver for lower level and genetic algorithm for upper level

You are passing a variable called xl to LLConstraint(), but xl is not used anywhere within that function. The function is theref...

3 days ago | 0

Answered

Efficient number occurence count

I want to efficiently count the number of occurences of numbers between 1-numel(num) in a Matrix If that's really what you want...

Efficient number occurence count

I want to efficiently count the number of occurences of numbers between 1-numel(num) in a Matrix If that's really what you want...

4 days ago | 0

Answered

Using fsolve with multiple unknowns

...but unsure on the syntax for a problem like this. The syntax does not change. It is simply that your equation expressions w...

Using fsolve with multiple unknowns

...but unsure on the syntax for a problem like this. The syntax does not change. It is simply that your equation expressions w...

4 days ago | 0

| accepted

Answered

Array value replace when change in row

A=randi([0,1],7,10); %Example [m,n]=size(A); [~,idx]=max(A,[],1); out = sparse(idx,1:n,1,m,n) ; A, full(out)

Array value replace when change in row

A=randi([0,1],7,10); %Example [m,n]=size(A); [~,idx]=max(A,[],1); out = sparse(idx,1:n,1,m,n) ; A, full(out)

4 days ago | 0

| accepted

Answered

Create column vector with same length as a matrix(6x6).

Taking the question literally, one solution would be, (1:6).' but I feel there must be missing information.

Create column vector with same length as a matrix(6x6).

Taking the question literally, one solution would be, (1:6).' but I feel there must be missing information.

4 days ago | 0

Answered

Name-Value Pairs error

If you use inputParser, you can define validation functions https://www.mathworks.com/help/matlab/ref/inputparser.html#d122e665...

Name-Value Pairs error

If you use inputParser, you can define validation functions https://www.mathworks.com/help/matlab/ref/inputparser.html#d122e665...

4 days ago | 0

| accepted

Answered

How to solve non-linear integer problems (MINLP/INLP)

You will have to use ga() in the Global Optimization Toolbox.

How to solve non-linear integer problems (MINLP/INLP)

You will have to use ga() in the Global Optimization Toolbox.

4 days ago | 0

| accepted

Answered

How to code my own Reshape function without using the built in reshape()??

Hint: Notice the effect of doing things like this: A=nan(3,4); A(:)=1:12

How to code my own Reshape function without using the built in reshape()??

Hint: Notice the effect of doing things like this: A=nan(3,4); A(:)=1:12

5 days ago | 0

| accepted

Answered

Fit the Data to a Quadratic Function with a y-offset (y = b+mx^2) error

I get no error messages when I run your code. However, you do not need fit() to perform this fit. You can just use polyfit, p=p...

Fit the Data to a Quadratic Function with a y-offset (y = b+mx^2) error

I get no error messages when I run your code. However, you do not need fit() to perform this fit. You can just use polyfit, p=p...

5 days ago | 1

| accepted

Answered

Fsolve cannot continue error

The error message is complaining about your objective function, not about FSOLVE. Make sure your objective function equil() is w...

Fsolve cannot continue error

The error message is complaining about your objective function, not about FSOLVE. Make sure your objective function equil() is w...

5 days ago | 0

Answered

unconstrained nonlinear optimization problem

Still, there are no constraints, so I think you should be using fminunc. Also, your revised objective function is not differenti...

unconstrained nonlinear optimization problem

Still, there are no constraints, so I think you should be using fminunc. Also, your revised objective function is not differenti...

5 days ago | 0

| accepted

Answered

Fill a nxm matrix with vectorised expression

No, there is no way to vectorize an element-wise function generically, without considering the specifics of the function. You ca...

Fill a nxm matrix with vectorised expression

No, there is no way to vectorize an element-wise function generically, without considering the specifics of the function. You ca...

5 days ago | 0

| accepted

Answered

Question about a statistics problem

I think you should just do, u = rand(sample_size,loop_times); number_of_success = sum(u<trueVal)

Question about a statistics problem

I think you should just do, u = rand(sample_size,loop_times); number_of_success = sum(u<trueVal)

6 days ago | 0

Answered

Finding maximum of a function using optimization toolbox

Assuming you are solving a separate optimization for each i (see my comment above), it seems to me that the solution is very sim...

Finding maximum of a function using optimization toolbox

Assuming you are solving a separate optimization for each i (see my comment above), it seems to me that the solution is very sim...

6 days ago | 0

| accepted

Answered

Trying to Loop through different values of two matrixes simultaneously

You can form all combinations of two matrices using ndgrid, A=rand(3), B=rand(3) [AA,BB]=ndgrid(A,B)

Trying to Loop through different values of two matrixes simultaneously

You can form all combinations of two matrices using ndgrid, A=rand(3), B=rand(3) [AA,BB]=ndgrid(A,B)

6 days ago | 0