# 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 287,789

REPUTATION**30,096**

CONTRIBUTIONS

**254** Questions

**11,553** Answers

ANSWER ACCEPTANCE **
77.17%
**

VOTES RECEIVED**3,983**

RANK**217** of 19,432

REPUTATION**6,295**

AVERAGE RATING**4.90**

CONTRIBUTIONS**36** Files

DOWNLOADS **298**

ALL TIME DOWNLOADS**52898**

RANK

of 141,644

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**

Creating multiple cylinders in different coordinates

Using cylindricalFit() from this FEX download https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-...

16 hours ago | 0

How many workers for fmincon with UseParallel?

Is the reason to set UseParallel to true when solving a problem with fmincon that it can potentially speed up the evaluation of ...

21 hours ago | 0

| accepted

How to find the span of a matrix in matlab?

You can use this, https://www.mathworks.com/matlabcentral/fileexchange/77437-extract-linearly-independent-subset-of-matrix-colu...

1 day ago | 0

Question

Reliably determine RAM consumption of MATLAB variables

I am looking for a reliable way to determine how much RAM is devoted to Matlab variable data at a given moment. The whos() comma...

1 day ago | 0 answers | 0

### 0

answersError using trainNetwork - possible change with Matlab release?

Convert the data to cell array form. XTrain=num2cell(Xtrain,[1,2,3]); XTrain=XTrain(:); YTrain=num2cell(YTrain); YTr...

2 days ago | 0

Need to fit a curve to some data points

x = [1 2 100]; y = [55 22 0]; ylog=log(y+eps); p=polyfit(x,ylog,2); f=@(x) exp(polyval(p,x)); %The fitted function ...

5 days ago | 0

Need to fit a curve to some data points

This uses the fminspleas downloadable, x = [1 2 100]; y = [55 22 0]; flist={@(p,x)1./(x-p(1)).^p(2)}; [p,A]=fminspleas(f...

5 days ago | 0

Discretizing a column array, and performing operations on elements of another column array of the same length that lie in the same bins as the original one

G=findgroups( discretize(Z,edges) ); Fbinned = splitapply(@(z) mean(z,1) , F, G);

5 days ago | 0

How to restrict tensorprod (with contraction) to only give certain results?

No, you cannot. pagemtimes is the appropriate solution.

6 days ago | 0

| accepted

different results with fmincon

function [c,ceq] = nonlcon(x,B,v) [~,difference]=fun(x,B,v); c=max(difference)-0.001; ceq=[]; end

6 days ago | 0

| accepted

Transform coordinates into pixel

Use getframe and writeVideo like in this example: https://www.mathworks.com/help/matlab/ref/videowriter.writevideo.html#mw_6dab...

6 days ago | 0

| accepted

Extracting tables within a cell.

when try to run a loop to extract these elements and have them written out the loop isn't going past the first cell and only re...

6 days ago | 0

Question

Why don't getframe RGB codes agree with plotted polyshape RGB codes?

In the code below, I have computed the RGB color code of the square as seen in both a polyshape plot (polyshapeRGB) and as seen ...

7 days ago | 1 answer | 0

### 1

answerLocate two neighboring nodes in space so as to divide the matrix into two

load xydata xy %Original 3D data mapped to 2D xy=xy(tspsearch(xy,5),:); %tspsearch is on the file exchange P=polyshape(xy,...

7 days ago | 0

| accepted

Loading multiple structure from a folder

It is because not all of the sub-structures mydata(n).data have the same fields. If you contest that, attach the mydata variable...

7 days ago | 0

| accepted

Can a ROI shape (ie. a Rectangle made by drawRectangle()) be a property of a class?

You need to specify the complete class name: classdef device properties tag string shape images.ro...

8 days ago | 0

| accepted

How to create struct from fieldnames and values cell arrays for code generation ?

Does it support transpose for normal arrays? If so, then you might be able to do, list_fields = {'a'; 'b'; 'c'; 'd'}; % the fu...

8 days ago | 0

Four-parameters optimization of a 1D function: wrong values

I would recommend using fminspleas, https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas with INLP=[p2,p3,p4...

8 days ago | 0

Solve for A matrix in Ax = 0

n=numel(x); mask=tril(triu(ones(n),-1),+1); %tridiagonal mask A=optimvar('A',[n,n]); prob = eqnproblem; prob.Equation...

9 days ago | 0

| accepted

negative value structural similarity index

A negative SSIM value means the values in those regions tend to be negatively correlated. When X goes low, then Y tends to go hi...

10 days ago | 0

How to handle imagedatastore when input and response have different dimension?

Modify the trntf_input, trntf_label datastores' ReadFcn so that when it reads in the image, it wraps it in a 1x1 cell array. S...

10 days ago | 0

| accepted

How to plot 3D plane of surface with 3 coordinates data?

You can use planarFit, from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools...

10 days ago | 1

| accepted

Cure fitting - lsqnonlin

I initially inputted my guess, lower bound, and upper bound with the true optimized values obtained from a published paper. Surp...

10 days ago | 1

What would be the equation of the following surface?

You could try fitting a 2D Gaussian surface to it, e.g., with this FEX download, https://www.mathworks.com/matlabcentral/fileex...

10 days ago | 0

Finding Transformation Matrix of a viewer3d object

I think the 3x4 camera projection matrix P would be, h=gca(); camz=h.CameraTarget-h.CameraPosition; camy=-h.CameraUpVector; ...

11 days ago | 1

| accepted

Uploading .mat files that contain nested structs into a datastore

This example shows how to use a fileDataStore to read partial data from a .mat file https://www.mathworks.com/help/matlab/ref/m...

11 days ago | 0

Which optimization tool should be used for solving my convex optimization problem?

If, as you seem to, you have a non-quadratic (and therefore also nonlinear) convex objective function, then you must use fmincon...

11 days ago | 0

Fixed-distance of legend outside plot axes

is there any "simple" parameter (i.e., not position) which controls the vertical distance between the legend box and the upper e...

11 days ago | 1

| accepted

the arc using the chord

Assume the chord is of length L and, with no loss of generality, assume also that it is aligned with the x-axis with end points ...

11 days ago | 1

Dot Multiplication in MATLAB

For matrices A and B, the rule is generally that A.* B is element-by-element multiplication a(i,j).*b(i,j), which means that nor...

11 days ago | 1

| accepted