5,196 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

Is there a possibility to use 3D sparse matrices on GPU?

There is not. However, with sparse matrices, it would make more sense just to embed your 1000x1000 pages into larger 2D block di...

Is there a possibility to use 3D sparse matrices on GPU?

There is not. However, with sparse matrices, it would make more sense just to embed your 1000x1000 pages into larger 2D block di...

1 day ago | 2

| accepted

Answered

How to store the results of a function using for-loop

T=cell(1,3); for i=1:3 T{i}=P(i)/(x.*y.*z); end

How to store the results of a function using for-loop

T=cell(1,3); for i=1:3 T{i}=P(i)/(x.*y.*z); end

2 days ago | 0

| accepted

Answered

GPU arrayfun is so slow, what is going on?

What is the most efficient way to vectorize the above code I would say, as follows, idx_Neighbor=randi([1 N],60,N,'uint8'); ...

GPU arrayfun is so slow, what is going on?

What is the most efficient way to vectorize the above code I would say, as follows, idx_Neighbor=randi([1 N],60,N,'uint8'); ...

2 days ago | 0

| accepted

Answered

How to concatenate structs with different fieldnames?

[Object(1:2).Stats]=deal( struct('Var1', [], 'Var2', [])); %first, do this Object(1).Stats.Var1 = 1; Object(1).Stats.Var2 =...

How to concatenate structs with different fieldnames?

[Object(1:2).Stats]=deal( struct('Var1', [], 'Var2', [])); %first, do this Object(1).Stats.Var1 = 1; Object(1).Stats.Var2 =...

2 days ago | 0

Answered

Rotating and shifting a meshgrid

theta=-10; shift=[1,1]*175.5362; R=[cosd(theta) -sind(theta); sind(theta) cosd(theta)]; szx=size(Xq); X...

Rotating and shifting a meshgrid

theta=-10; shift=[1,1]*175.5362; R=[cosd(theta) -sind(theta); sind(theta) cosd(theta)]; szx=size(Xq); X...

2 days ago | 0

Answered

How do I correctly use the Syntax of fmincon?

If you do not have any linear constraints, then just set them empty A=[]; b=[];

How do I correctly use the Syntax of fmincon?

If you do not have any linear constraints, then just set them empty A=[]; b=[];

3 days ago | 0

| accepted

Answered

MINIMIZE A FUNCTION WITH CONSTRAINTS

You might consider this modification, function [ DD ] = overall( x ) global par par2 x1=x(1); x2=x(2); x3=x(3); y= pa...

MINIMIZE A FUNCTION WITH CONSTRAINTS

You might consider this modification, function [ DD ] = overall( x ) global par par2 x1=x(1); x2=x(2); x3=x(3); y= pa...

8 days ago | 0

Answered

How to obtain the minimum square full rank sub-matrix in a sparse matrix?

This article may help: Computing the Block Triangular Form of a Sparse Matrix by Alex Pothen and Chin-Ju Fan. They talk about so...

How to obtain the minimum square full rank sub-matrix in a sparse matrix?

This article may help: Computing the Block Triangular Form of a Sparse Matrix by Alex Pothen and Chin-Ju Fan. They talk about so...

9 days ago | 1

| accepted

Answered

How can I define a constraint to my optimization problem?

Aineq=kron(speye(t),d_ik(:).'); bineq=TR; Note also that your call to intlinprog is the wrong syntax. You haven't specified ...

How can I define a constraint to my optimization problem?

Aineq=kron(speye(t),d_ik(:).'); bineq=TR; Note also that your call to intlinprog is the wrong syntax. You haven't specified ...

9 days ago | 0

| accepted

Answered

Plotting a 3D matrix over time

If your final data set is a 3x3xN array, D, you can reshape and plot it as follows plot( reshape(D,9,N).' ) This will display ...

Plotting a 3D matrix over time

If your final data set is a 3x3xN array, D, you can reshape and plot it as follows plot( reshape(D,9,N).' ) This will display ...

10 days ago | 0

Answered

Sum specific range of column or row

sum(yourMatrix,2)-yourMatrix(:,1);

Sum specific range of column or row

sum(yourMatrix,2)-yourMatrix(:,1);

10 days ago | 0

| accepted

Answered

How to transform a matrix into a 3D array (tensor) ?

A=[1,2;3 4].*reshape([1,10,100], 1,1,[])

How to transform a matrix into a 3D array (tensor) ?

A=[1,2;3 4].*reshape([1,10,100], 1,1,[])

10 days ago | 0

Answered

Large Matrices for solving linear systems

values=[-4,1,1,1,1]; A=toeplitz([values(:), zeros(N-numel(values),1) ]);

Large Matrices for solving linear systems

values=[-4,1,1,1,1]; A=toeplitz([values(:), zeros(N-numel(values),1) ]);

10 days ago | 0

Answered

How can I populate a matrix of zeros, with a value of 1 at specific rows and columns?

pacman=~pacman_matrix;

How can I populate a matrix of zeros, with a value of 1 at specific rows and columns?

pacman=~pacman_matrix;

11 days ago | 0

Answered

How can I populate a matrix of zeros, with a value of 1 at specific rows and columns?

matrix = sparse(x,y,1,m,n)

How can I populate a matrix of zeros, with a value of 1 at specific rows and columns?

matrix = sparse(x,y,1,m,n)

11 days ago | 0

Answered

how to read number from picture

You can use the OCR command, if you have the appropriate Toolbox(es).

how to read number from picture

You can use the OCR command, if you have the appropriate Toolbox(es).

12 days ago | 1

| accepted

Answered

I can't find the solution how can i fix this?

You need to distinguish better between the roles of the index i and of the values xr(i) in the code. clear xr i=1; xr(1)=0; ...

I can't find the solution how can i fix this?

You need to distinguish better between the roles of the index i and of the values xr(i) in the code. clear xr i=1; xr(1)=0; ...

13 days ago | 0

Answered

Convert Nested for-Loops to parfor

You can convert the first set of nested loops to a single parfor loop as below. The second set of nested-loops is non-paralleliz...

Convert Nested for-Loops to parfor

You can convert the first set of nested loops to a single parfor loop as below. The second set of nested-loops is non-paralleliz...

13 days ago | 0

Answered

Fast methods of solving equations (alternative methods instead of backslash)

Following Christine's suggestion, here is a simple test of slice-wise backslashing between two 512x512x512 arrays. I find it tak...

Fast methods of solving equations (alternative methods instead of backslash)

Following Christine's suggestion, here is a simple test of slice-wise backslashing between two 512x512x512 arrays. I find it tak...

14 days ago | 0

Question

Separately license additional toolboxes

My institution has a Concurrent Academic license which provides us with Matlab and a certain bundle of toolboxes. I would now li...

14 days ago | 1 answer | 1

Answered

How can i take specific values from a matrix and put them into another matrix?

Let's say your matrix is A, Matrices=splitapply(@(z){z},A,A(:,2))

How can i take specific values from a matrix and put them into another matrix?

Let's say your matrix is A, Matrices=splitapply(@(z){z},A,A(:,2))

14 days ago | 0

| accepted

Answered

How can i take specific values from a matrix and put them into another matrix?

sortrows(yourMatrix,2)

How can i take specific values from a matrix and put them into another matrix?

sortrows(yourMatrix,2)

14 days ago | 1

Answered

Help with adding a column with numbers that are repeated to a matrix

Let's say your matrix is A, A(:,2)=mod(0:2169,12)+1;

Help with adding a column with numbers that are repeated to a matrix

Let's say your matrix is A, A(:,2)=mod(0:2169,12)+1;

14 days ago | 0

Answered

OOP: Select Data with conditional

In this scenario, it is better to have a single object whose properties are arrays than an array of objects whose properties are...

OOP: Select Data with conditional

In this scenario, it is better to have a single object whose properties are arrays than an array of objects whose properties are...

14 days ago | 1

Answered

Why are my plot coming out linear when they're supposed to be curves?

Use ./ and .* for component-wise division and multiplication.

Why are my plot coming out linear when they're supposed to be curves?

Use ./ and .* for component-wise division and multiplication.

15 days ago | 0

| accepted

Answered

Can I make this for loop fast?

Here I make occasional use of MAT2TILES (Download), UK=cell2mat( mat2tiles( U_new'*cell2mat(K111(:).') ,[20,200]).' ); KQQ...

Can I make this for loop fast?

Here I make occasional use of MAT2TILES (Download), UK=cell2mat( mat2tiles( U_new'*cell2mat(K111(:).') ,[20,200]).' ); KQQ...

15 days ago | 0

| accepted

Answered

removing FOR loop to solve Ax=B on multidimensional arrays on GPU

C=pagefun(@mldivide,A,B)

removing FOR loop to solve Ax=B on multidimensional arrays on GPU

C=pagefun(@mldivide,A,B)

15 days ago | 2

| accepted

Answered

How can I write a self scaling function for fmincon ?

fun = @(x) -sum(log(x))

How can I write a self scaling function for fmincon ?

fun = @(x) -sum(log(x))

15 days ago | 1

| accepted