6,049 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 check if an entire column of string variables can potentially be converted to numerical values?

all(48<=yourMatrix(:) & yourMatrix(:)<=57)

How to check if an entire column of string variables can potentially be converted to numerical values?

all(48<=yourMatrix(:) & yourMatrix(:)<=57)

2 hours ago | 0

Answered

Calculating statistical functions for a structure array which each cell has a different size

A structure array doesn't have "cells" and doesn't look like that. I assume you really mean your data is a cell array, in which ...

Calculating statistical functions for a structure array which each cell has a different size

A structure array doesn't have "cells" and doesn't look like that. I assume you really mean your data is a cell array, in which ...

16 hours ago | 0

| accepted

Answered

For loop for summation

R= zeros(size(y)); N= -500:500; for j=1:numel(N) n=N(j); R = R + f(n).*y.^(-n); end

For loop for summation

R= zeros(size(y)); N= -500:500; for j=1:numel(N) n=N(j); R = R + f(n).*y.^(-n); end

16 hours ago | 0

Answered

How to check if an entire column of string variables can potentially be converted to numerical values?

~any(isletter(yourMatrix(:)))

How to check if an entire column of string variables can potentially be converted to numerical values?

~any(isletter(yourMatrix(:)))

16 hours ago | 0

| accepted

Answered

Superimposing matrices in a specific location

Something like this, perhaps: [i0,j0]=deal(700,850); %target location [I,J,S]=find(smallMatrix); result = largeMatrix + ...

Superimposing matrices in a specific location

Something like this, perhaps: [i0,j0]=deal(700,850); %target location [I,J,S]=find(smallMatrix); result = largeMatrix + ...

16 hours ago | 0

Answered

Trouble calculating column mean from a matrix - using different indices for each row

[m,n]=size(myMatrix); %Edited e=1:n; mask=VariableIndex1(:)<=e & e<=VariableIndex2(:); result=sum(myMatrix.*mask,2)./sum(...

Trouble calculating column mean from a matrix - using different indices for each row

[m,n]=size(myMatrix); %Edited e=1:n; mask=VariableIndex1(:)<=e & e<=VariableIndex2(:); result=sum(myMatrix.*mask,2)./sum(...

1 day ago | 0

| accepted

Answered

Kron error when dealing with sparse gpuarrays

You may want to look at, https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-kronecker-product...

Kron error when dealing with sparse gpuarrays

You may want to look at, https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-kronecker-product...

1 day ago | 0

Answered

Use several pools of workers in a parfor loop

Your terminology is a bit confusing. There is only ever 1 pool of workers, but each worker may use multiple cores and the entire...

Use several pools of workers in a parfor loop

Your terminology is a bit confusing. There is only ever 1 pool of workers, but each worker may use multiple cores and the entire...

2 days ago | 0

Answered

How to write your own function for infinity-norm of a matrix

To sum the rows of any matrix A, sum(A,2)

How to write your own function for infinity-norm of a matrix

To sum the rows of any matrix A, sum(A,2)

2 days ago | 0

Answered

Fastest way to substitute elements in a matrix at given positions?

idx = sub2ind([n,m], repmat((1:n).',1,l) ,B); A(idx)=value;

Fastest way to substitute elements in a matrix at given positions?

idx = sub2ind([n,m], repmat((1:n).',1,l) ,B); A(idx)=value;

3 days ago | 0

| accepted

Answered

Matlab fmincon(function based) optimality issue :: constrained nonlinear optimization

But , in my case, optimality is very large even though the objective fval is converge (please check img.) Your plots are uninte...

Matlab fmincon(function based) optimality issue :: constrained nonlinear optimization

But , in my case, optimality is very large even though the objective fval is converge (please check img.) Your plots are uninte...

3 days ago | 1

| accepted

Answered

How to use fzero in a loop to obtain the first 3 positve solutions for cos3x=sin3x?

It seems like a strange homework problem, since it is so easily solved analytically. Well, assuming we play dumb to that, you ne...

How to use fzero in a loop to obtain the first 3 positve solutions for cos3x=sin3x?

It seems like a strange homework problem, since it is so easily solved analytically. Well, assuming we play dumb to that, you ne...

3 days ago | 0

Answered

gap filling with liner interpolation

A=xlsread('data.xlsx'); I=A==-9999; J=find(~I); B=A; B(I)=interp1(J,A(J),find(I));

gap filling with liner interpolation

A=xlsread('data.xlsx'); I=A==-9999; J=find(~I); B=A; B(I)=interp1(J,A(J),find(I));

3 days ago | 0

| accepted

Answered

what is the source code of gridinterpolant function? what is the algorithm?

No, there is no way to see the souce code for griddedInterpolant.

what is the source code of gridinterpolant function? what is the algorithm?

No, there is no way to see the souce code for griddedInterpolant.

4 days ago | 1

| accepted

Answered

Rasterize a triangle in 3-D space.

One way is to use vert2lcon, https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional-polyhedra-in-term...

Rasterize a triangle in 3-D space.

One way is to use vert2lcon, https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional-polyhedra-in-term...

7 days ago | 0

Answered

How to find the x and y coordinates corresponding to a given value of f(x,y)?

maxval=max(f(:)); [xmax,ymax]=find(f==maxval);

How to find the x and y coordinates corresponding to a given value of f(x,y)?

maxval=max(f(:)); [xmax,ymax]=find(f==maxval);

7 days ago | 1

| accepted

Answered

Why do results of fft() on a matrix differ from fft() on one row as a vector?

The same dicrepancy exists with most Matlab functions that do operations along rows or columns. Here is the same test replacing ...

Why do results of fft() on a matrix differ from fft() on one row as a vector?

The same dicrepancy exists with most Matlab functions that do operations along rows or columns. Here is the same test replacing ...

7 days ago | 1

| accepted

Answered

why the script show wrong output can you help me?

tplot=[0:0.01:2*pi]; x=double(subs(pos,tplot)); y=double(subs(v,tplot)); z=double(subs(a,tplot)); p=plot3(x,y,z);

why the script show wrong output can you help me?

tplot=[0:0.01:2*pi]; x=double(subs(pos,tplot)); y=double(subs(v,tplot)); z=double(subs(a,tplot)); p=plot3(x,y,z);

7 days ago | 0

Answered

From a set of curves, how to find the one that the "most similar" to the reference curve?

The code below uses fminspleas https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas to do a simple 1D registr...

From a set of curves, how to find the one that the "most similar" to the reference curve?

The code below uses fminspleas https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas to do a simple 1D registr...

8 days ago | 0

Answered

Sparse gpuArray accumulation in for-loop

I would guess that your Kernel matrix is becoming less and less sparse as you accumulate until its memory consumption is growing...

Sparse gpuArray accumulation in for-loop

I would guess that your Kernel matrix is becoming less and less sparse as you accumulate until its memory consumption is growing...

8 days ago | 0

| accepted

Answered

Optimization with loops Error in optim.problemdef.OptimizationProblem/solve

I believe it will probably involve multiplication by some upper triangle matrices of 1 with some other operations but I cannot w...

Optimization with loops Error in optim.problemdef.OptimizationProblem/solve

I believe it will probably involve multiplication by some upper triangle matrices of 1 with some other operations but I cannot w...

8 days ago | 0

| accepted

Answered

Find the points on circumference of a circle

Okay Considering 5 pixels + or - for the inaccuracy to find all the x,y, points on the circumference; how can I find even those....

Find the points on circumference of a circle

Okay Considering 5 pixels + or - for the inaccuracy to find all the x,y, points on the circumference; how can I find even those....

8 days ago | 0

Answered

Matlab code to split an image into a square grid of square blocks

This uses mat2tiles (Download) A=mat2tiles( imread('cameraman.tif'), [32,32]); [m,n]=size(A); B=cell2mat(A(randperm(...

Matlab code to split an image into a square grid of square blocks

This uses mat2tiles (Download) A=mat2tiles( imread('cameraman.tif'), [32,32]); [m,n]=size(A); B=cell2mat(A(randperm(...

9 days ago | 0

| accepted

Answered

Find matching points from two coordinate systems

If the shear component of the deformation isn't too strong, the matchpoints function defined below might work. It will sort the ...

Find matching points from two coordinate systems

If the shear component of the deformation isn't too strong, the matchpoints function defined below might work. It will sort the ...

10 days ago | 0

Answered

Find cycles in an undirected graph

Because this sounds like a generally useful thing, I cooked up the attached polyregions class to do the partitioning that you de...

Find cycles in an undirected graph

Because this sounds like a generally useful thing, I cooked up the attached polyregions class to do the partitioning that you de...

10 days ago | 1

| accepted

Answered

Function handle for combinations of calculations

One way: N=5; [G{1:N}]=ndgrid([-1,1]); G=reshape(cat(N+1,G{:}) , [],N); and now the combinations are given by ...

Function handle for combinations of calculations

One way: N=5; [G{1:N}]=ndgrid([-1,1]); G=reshape(cat(N+1,G{:}) , [],N); and now the combinations are given by ...

10 days ago | 0

| accepted

Answered

I need help with this MATLAB question

I know how to get user input but how do i get it through a pop up box? One option is inputdlg, https://www.mathworks.com/help...

I need help with this MATLAB question

I know how to get user input but how do i get it through a pop up box? One option is inputdlg, https://www.mathworks.com/help...

10 days ago | 1

Answered

How do I reorder unequal columns in a field

yourStruct.Vs=permute(yourStruct.Vs,[2,1,3]);

How do I reorder unequal columns in a field

yourStruct.Vs=permute(yourStruct.Vs,[2,1,3]);

11 days ago | 0