# Matt J

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.

**Statistics**

RANK**6**

of 272,923

REPUTATION**26,754**

CONTRIBUTIONS

**225** Questions

**10,314** Answers

ANSWER ACCEPTANCE **
74.67%
**

VOTES RECEIVED**3,505**

RANK**230** of 18,433

REPUTATION**5,831**

AVERAGE RATING**4.90**

CONTRIBUTIONS**35** Files

DOWNLOADS **381**

ALL TIME DOWNLOADS**48800**

RANK

of 122,311

CONTRIBUTIONS

**0** Problems

**0** Solutions

SCORE**0**

NUMBER OF BADGES**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**3** Highlights

AVERAGE NO. OF LIKES**2**

**Content Feed**

How to find the closest values (positive and negative) to the line when X is zero?

load Data %Create line plot [x,is] = sort(V); y = J(is); in=find(x<0,1,'last'); ip=find(x>0,1,'first'); [xn,yn, ...

2 hours ago | 0

| accepted

Objective function for fmincon from surrogate model

Can't you just do, fun=@(X) norm(mdl.predict(X)-y).^2

4 hours ago | 0

Is it possible to add more constraints than the default ones in LSQLIN function?

You can still use lsqlin, but as John said, you can add additional inequality constraints as follows, Q=-sign(d).*C; r=zeros(s...

10 hours ago | 0

Optimising Limits of Chain integrals

There is virtually no benefit to the problem based approach if you are going to use fminunc. The main advantage of problem-base...

10 hours ago | 0

Cross-correlation of two complex signals using sliding dot product

If there is to be no zero-padding, what should happen when the shorter signal slides to the edge of the longer signal? Does the ...

21 hours ago | 0

| accepted

Finding Roots between a Differential and Piecewise Equation

a=1; [t_root,fval]=fzero(@(t)rootFcn(t,a), pi) function out=rootFcn(t,a) xp1 =@(t) ((-(8*2)/(2^2+1))*cos(t))+((8/(2^2+...

23 hours ago | 0

| accepted

Effect of zero padding on FFT amplitude

Here is an example showing that the amplitude of an FFT does not change due to zero-padding. In all cases, the peak amplitude is...

23 hours ago | 1

Projection using Modified Gram-Schmidt orthogonality

Aorth=orth(A); %A orthogonalized ProjB=Aorth*(Aorth.'*B); %projection of B

24 hours ago | 0

| accepted

How to use conditional bounds for parameters with lsqcurvefit?

You must divide the problem into two cases: one case where X0 is fixed at 0 and the second when Y0 is fixed at zero. xdata = 0:...

1 day ago | 3

| accepted

When using JacobianMultiplyFcn in lsqnonlin, why is Jinfo required to be numeric? How can I pass more general kinds of parameters to my JacobianMultiplyFcn?

I seem to be have been able to fool lsqnonlin into doing what I want by using the attached classdef. Still, I wonder why the Opt...

1 day ago | 0

Submitted

Tools for Processing Consecutive Repetitions in Vectors

A set of functions for labeling and manipulating groups of consecutively repeating elements in a vector.

1 day ago | 3 downloads |

Latex typesetting in Livescript

I have expressed a desire to have \label{} and \ref{} in LiveScript, https://www.mathworks.com/matlabcentral/answers/1723075-au...

2 days ago | 0

calculate the euclidean distance among all the pairs of nodes and use those resulting distances as the edges weights of the graph

This is already done in spatialgraph2d() https://www.mathworks.com/matlabcentral/fileexchange/73630-spatialgraph2d which I thi...

2 days ago | 0

| accepted

Cut off a Curve created by "curve fit"

This might be what you want: for i = 1:12 x1 = [emax(i); emid(i); 0]; y1 = [vmax(i); vmid(i); dvc(i)]; p = pol...

2 days ago | 0

Question

When using JacobianMultiplyFcn in lsqnonlin, why is Jinfo required to be numeric? How can I pass more general kinds of parameters to my JacobianMultiplyFcn?

What I would like to do is use the JacobianMultiplyFcn option of lsqnonlin's trust-region-reflective algorithm where Jinfo is a...

2 days ago | 1 answer | 0

### 1

answerlimiting broadcast variables in parfor loops

The block decomposition that you are doing needs more explanation. If the blocks are just fixed-sized, non-overlapping tiles of ...

3 days ago | 0

how to run a function on GPU cores

so it would be great if we could have a function like "parfor" for GPU-based parallel processing. No, you cannot use GPU cores ...

3 days ago | 0

| accepted

MATLAB Problem. How to design matrix from eigenvalues

mindist=@(A) min(sqrt(pdist(real(A(:))).^2+pdist(imag(A(:))).^2)); n=5; Q=rand(n); Q(1)=0; Q=(1-eye(n)).*Q*0.5/mindist(...

3 days ago | 0

| accepted

MATLAB Problem. How to design matrix from eigenvalues

mindist=@(A) min(sqrt(pdist(real(A(:))).^2+pdist(imag(A(:))).^2)); n=5; P=rand(n); D=diag(rand(1,n)); A=P*D/P; A=A/mi...

3 days ago | 1

extract data points where the slope (derivative) of the plot changes suddenly

data=[ 1 2 3 4 3 2 1] loc=abs(diff(data,2)) > 1 loc=[false, loc ,false]; %pad with zeros because diff() shortens the vect...

3 days ago | 0

Extracting data points (with specific coordinates) from plot

For example, Y=40+0.04*linspace(-1,1,10) data=10*(1:numel(Y)) data_Extracted = data(abs(Y-40)<=0.01)

3 days ago | 0

Make loop more efficient

Simpler: A=rand(5), I=(A<0.5); A(I)=A(I)+1,

3 days ago | 0

| accepted

I am trying to replace the objective function of neural network to customised one

This talks about supplying a custom model function for NN training: https://www.mathworks.com/help/deeplearning/ug/train-networ...

3 days ago | 0

Use of fmincon with objective function as m-file

One way is to wrap the functions in an anonymous function: fun=@(X) objective_fn(V_exp, volt(O_plus,O_minus,X,L_a,L_c,I_app,t)...

3 days ago | 1

Fminsearch results shows shift from measured curve. How should I solve this?

The x_Start=[1,1] selection looks very arbitrary. If one of the parameters is the oscillation amplitude, it should be closer to ...

3 days ago | 0

Dividing each row in a 48X5120 int32 with the maximum value in the row

A=double(A); result = A./max(A,[],2)

3 days ago | 0

| accepted

Custom Matrix Interpolation for every 10 numbers in each column

A=reshape(1:40,[],2); A(10:end,:)=A(10:end,:)*2; A=A(1:5:end,:); %hypothetical input M=5; %upsampling factor A=kron(A...

4 days ago | 0

| accepted

latex in text doesn't work

gca; s=sprintf('$\\tilde{y}_x$ = %.3f',5) text(0.5, 0.5,s, ... 'Interpreter', 'LaTeX','fontsize', 30);

4 days ago | 0

Scaling in optimization problems

the derivate with dV/dc will get ever smaller with t. It's not clear that that matters because the values of c are also influe...

4 days ago | 0

| accepted