Community Profile # Matt J

Last seen: Today Active since 2009

Professional Interests: medical image processing, optimization algorithms

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

How can i solve this cost function?
v = [(1 / (0.47 * 0.94 * 1500)^2) (1 / (0.47 * 0.94 * 1700)^2) (1 / (0.47 * 0.94 * 2000)^2) (1 / (0.47 * 0.94 * 2200)^2)]; delt...

7 hours ago | 1

| accepted

Text comparisons no longer work with arrays in 2022a
There's been no change. cell arrays still work: [tf,loc]=ismember('cat',{'dog','fish','cat'})

1 day ago | 1

How to find the constant of a line function
Evaluate the function at x=0.

1 day ago | 0

| accepted

Min of each column of a sparse matrix?
result = -log( max( spfun(@(x)exp(-x), yourMatrix) ,[],1) );

1 day ago | 0

Create random numbers inside a specific plane in xy plane
I don't understand how you are specifying your parallelograms. However, one way is to use ndgrid and then apply a shear: [X,Y]=...

1 day ago | 0

Generating all unique binary vectors of length N given certain criteria
N=5; A=triu(ones(N)); B=~eye(N); B=B(2:end-1,:); c=nchoosek(2:N-1,2); C=(1:N); C=C<c(:,1)|C>c(:,2); result=...

1 day ago | 0

How to join or merge two Image Data Stores?
Perhaps by wrapping them in a TransformedDataStore (R2019a and higher), imdsnew = transform(imds1,imds2, @(x) x)

1 day ago | 0

Can i continue to run my matlab programs even when the computer screen is locked using Win+L
Yes, it will continue to run.

1 day ago | 0

| accepted

how can I have a perfect rect function as the result of applying fft on sinc function?
I want exactly a rectangle like what we have in theory. The FFT of a sinc function is not a perfect rect, even in theory. The ...

2 days ago | 1

Plotting from function per for-loop iteration
If you want new figure windows for each plot, don't specify a number for them: figure scatter(x,y) figure scatter(x+y,y)

3 days ago | 1

| accepted

How to find intersection points of multiple line segments in 3D?
If you generate them randomly, they will not intersect. However, generatig and plotting them is no problem, numlines=5; for ...

3 days ago | 0

matlab function on a grid along third dimension
No, you can't. However a 3x3x3 array is too small for a loop to suffer any serious penalties.

3 days ago | 0

How to eliminate the elements in an array from another array when there are repeated elements in both arrays?
A = [ 1,2,2,2,3,4]; B = [1,2,2,3]; Au=[unique(A),inf]; reps=max( histcounts(A,Au)-histcounts(B,Au) ,0); C=repelem(Au...

3 days ago | 0

Restricting solutions using lsqnonlin with complex unknowns
l1,L2,L3 are complex numbers, where the real and imaginary part are two sepparate unknowns, If so, then you have 12 unknowns, ...

4 days ago | 0

| accepted

Incorrect lsqcurvefit fitting, stays in initial guess
xdata =[2.00E-05 2.45E-05 3.00E-05 3.70E-05 4.55E-05 5.55E-05 6.75E-05 8.25E-05 1.01E-04 ... 1.24E-04 1.51E-04 1.85E-04 2.2...

4 days ago | 0

| accepted

how to find a normal vector?
In my case, P1 point wil be the V0 and P1 for this function. You need 3 distinct, non-colinear points in a the plane to calcula...

4 days ago | 0

| accepted

How to have elementwise multiplication expand in two dimensions?
C=A.*reshape(B,[16,16,3,1,7]); C=reshape(C,[16,16,3,700]);

5 days ago | 1

| accepted

Can I disable intermediate calculations for fmincon
Since you are specifying the objective gradient, finite difference calculations will not be executed for that particular piece o...

5 days ago | 0

| accepted

How to vertically concatenate certain fields of a structure on each pass of a loop?
clear results for k=numel(files):-1:1 ..... data=pulldata(filename); results(k)=analyzedata(data); end ...

6 days ago | 1

string matrix navigation with character string
DataSour = ["Do" "Ri" "Mi"; "AA" "VV" "Fa"; "SS" "BB" "Do"; "Do" "yy" "zz"]; ToAssign = "Do"; [ColPos,RowPos]=find(DataSour'...

13 days ago | 0

Eig takes too long
Does anyone have any suggestions or advice that can help speed up this calculation if that is even possible? I don't think the...

13 days ago | 0

parabolic fit and extend upwards in 4 points
Use polyfit.

13 days ago | 0

How to resolve : increase max function value in fitting using fminsearch?

13 days ago | 0

How to resolve : increase max function value in fitting using fminsearch?
You could do as the message says and increas MaxFunEvals, but for your model, it would be better to download fminspleas, https:...

13 days ago | 0

| accepted

Calculation of the surface area of a generic solid
One way might be to read the stl file into a triangulation object using stlread. With the triangulation object, you can use free...

13 days ago | 0

Submitted

spatialgraph2D
Creates a graph object with 2D spatial locations associated with the nodes 