Community Profile

# Matt J

Last seen: Today Active since 2009

Professional Interests: medical image processing, optimization algorithms

All

#### Content Feed

View by

Failure in initial user-supplied nonlinear constraint function evaluation
One problem: nonlcon = @simple_constraint; There is no function called 'simple_constraint' in your attached script. There is a...

etwa 3 Stunden ago | 1

for loop for permutations of for length of array
List=nchoosek([a,b,c],2); for i=1:size(List,1) p1=List(i,1); p2=List(i,2); ... end

etwa 20 Stunden ago | 1

| accepted

2*2 Matrix factorization/decomposition
I also found out what I wanted may have something to do with PLU(permuted lower upper decomposition), but am clueless to how to ...

ein Tag ago | 0

How can I call a script within a for loop, looping over multiple files?
result = scriptname(ID{nSubject},Visit{nVisit});

ein Tag ago | 0

| accepted

I am trying to find the exact distance of a curvy line.
Why not as follows? I2 = imread('image.jpeg'); blue=bwareafilt( I2(:,:,1)<=50 & I2(:,:,2)<=50 & I2(:,:,3)>=200, 1); Len...

2 Tage ago | 0

Number of branches per branch point
Perhaps as follows: k=ones(3); k(5)=0; neighborCount=conv2(double(BW),k,'same'); neighborCount=neighborCount.*(neighborCo...

2 Tage ago | 0

| accepted

Rank deficient error.
Are you attempting to do matrix division? if not use ./ instead.

2 Tage ago | 1

| accepted

Merge struct with matrix
You cannot avoid a for-loop altogether, but you can avoid writing your own for-loop as follows: tmp=num2cell(modelOutputSignal,...

2 Tage ago | 0

| accepted

Unable to detect Iris boundary using imfind circles
Increasing the lower radius bound as suggested by @Jonas as well as increasing the sensitivity setting seems to help: A=any( im...

2 Tage ago | 0

| accepted

adjusting the code from optimization output from minimum to maximum
fun=str2func(FUNCTION_NAME); fun=@(x) -fun(x); [Scaled_x_Single,fval,exitflag,output,population,scores] = ga(,3,[],[],[],[],...

3 Tage ago | 0

Question

Re-import a binary map into Image Segmenter or Color Thresholder
I have generated a binary mask of an image using the Image Segmenter app. I am wondering if it is possible to re-import that mas...

3 Tage ago | 1 answer | 0

### 1

Find elements from a submatrix in the main 3D matrix
[row,col]=find( reshape( ismember(M(:),A(:)) , size(M) ) );

3 Tage ago | 1

| accepted

How to smooth data to a negative curve
Thie File Exchange submission allows you to do spline smoothing with monotonicity constraints: https://www.mathworks.com/matlab...

3 Tage ago | 0

| accepted

Create new field on struct from names on existing field
names={Stimuli.names}; idxBlue=contains(names,["H1" "H2" "H3"]); idxRed =contains(names,["H4" "H5" "H6"]); [Stimuli(idxBlue...

3 Tage ago | 0

| accepted

How to guide bwconncomp to specific region of image?

4 Tage ago | 0

Calculating efficiently the euclidean distance
In recent Matlab, you can just do, vecnorm(A(:, 1:2) - A(:, 3:4),2,2); In less recent Matlab, you can do, sqrt(sum( (A(:, 1:...

4 Tage ago | 1

| accepted

How to map subdivisions in a squared geometry
I can't tell from your code what the rules are that determine which cells are connected to or interact with other cells. However...

4 Tage ago | 0

Confusing about applying weighted least square for constant fitting
I would recommend lscov p=lscov(x(:).^[1,0],y,w/N); yfit=polyval(p,x)

4 Tage ago | 0

| accepted

How to run a matlab function using a button pushed in AppDesigner
The typical way would be to invoke addition() from your callback the way you would from any ordinary function, function Execute...

4 Tage ago | 1

| accepted

How to generate a connection graph with vertices and edges
I don't know if you even need a for-loop. You should probably just build a graph object using one of the syntaxes listed in the ...

4 Tage ago | 1

| accepted

Delete the line that are repeated
what I want to do is to delete from the old strings the lines that are in the new one. For example, oldstring=["dog"; "fish"; ...

4 Tage ago | 0

Get coefficients of variables in constraints (solver-based approach)
Yes, you can use prob2struct or prob2matrices: https://www.mathworks.com/matlabcentral/fileexchange/74481-prob2matrices-a-sele...

5 Tage ago | 2

| accepted

fitting straight line to part of data and extrapolate to x-axis at y = zero
region=(y<0.01); p=polyfit( x(region),y(region) ,1); xroot= roots(p) % the extrapolated root

6 Tage ago | 0

Why can I not open task in live script?
I don't know for sure if this applies to you, but I experienced similar errors due to some modifications to default groot settin...

6 Tage ago | 0

Question

ConvNets and sliding windows
(Rephrased) I am starting to play with the Deep Learning Toolbox and deepNetworkDesigner. An example of what I'd like to be abl...

6 Tage ago | 1 answer | 0

### 1

Question

appdesigner does not save to current folder
I have composed a blank app in appdesigner and added a button to it. Then, I try to save it. When I do, the resulting .mlapp fil...

6 Tage ago | 1 answer | 0

### 1

Dividing elements of matrices where the matrices are in a cell array
What you've shown should work, but since the cell array contents are identical, it would be faster to do, scale=rundata; scale...

6 Tage ago | 0

| accepted