Answered
Fill a specific region of fcontour without generating a mesh
Using the FEX download getContourLineCoordinates, fun=@(x,y)x.^2+y.^2-1; M=fcontour(fun,[-pi pi -pi pi],'LevelList',[0,1,2...

2 years ago | 3

| accepted

Answered
How do you convert the left picture (a) into the right picture (b) using image processing toolbox?
[R,G,B]=imsplit(imread('Image.png')); BW=imfill( bwareaopen(R>130 & G>130 & B>110,10) ,'holes'); imshow(~BW)

2 years ago | 0

| accepted

Answered
Optimizing a matrix of values
You could define the whole matrix as unknown, but with diagonal elements bound to zero: LB=-inf(n); LB(1:n+1:end)=0; UB=-LB;...

2 years ago | 0

| accepted

Answered
groupcounts and sum of data in another array in the same order
accumarray(findgroups(A(:)), B(:))

2 years ago | 0

Answered
groupcounts and sum of data in another array in the same order
splitapply(@sum,B,findgroups(A))

2 years ago | 0

Answered
How to find the optimum number of neurons and hidden layers for ANN?
By trial and error, though you can automate some of that using the Experiment Manager.

2 years ago | 0

Answered
how to enlarge ROI around its boundary?
Isn't there something available that operates directly on the position data of Matlab ROI objects...? You can make a polyshape ...

2 years ago | 0

Answered
Trying to use function ,didnt work?
when i typed it like this it gave me error I doubt it gave you an error. It certainly doesn't give me one. You probably got a ...

2 years ago | 0

| accepted

Answered
How to use least-square fit and gaussian surface for 3D data?
This FEX file will fit a Gaussian with a constant background in any dimension, https://www.mathworks.com/matlabcentral/fileexch...

2 years ago | 1

Answered
Input multiple region for polyshape
There is no unique way to divide a series of points into closed polygons. If you haven't inserted the NaNs already, the intended...

2 years ago | 0

Answered
Function that makes Anonymous Functions
When I attempted this, the anonymous function contained variables instead of numerical coefficients I assume you mean that in t...

2 years ago | 0

| accepted

Answered
Why does argmin index of NaN array have a value of 1 and not NaN?
I imagine it is so that the logical test tf (below) will always return true. If the I output were NaN, an error message would r...

2 years ago | 0

| accepted

Answered
How to open neural network training screen?
I don't know what you mean by the "net.mat file" and I don't think you can reopen the screen. However, if you called trainlm wit...

2 years ago | 0

Answered
Numerical first derivative of irregularly spaced data
It seems to work: t=sort( rand(1,1000)*2*pi ); cos_t=gradient(sin(t))./gradient(t); I=1:20:1000; plot(t,cos(t),'b--' , t...

2 years ago | 0

| accepted

Answered
removeLayers function: Incorrect number or types of inputs or outputs for function removeLayers.
Your layers variable is a Layer object array, whereas removeLayer requires the input to be a LayerGraph. It is unnecessary, in a...

2 years ago | 1

| accepted

Answered
Generating numbers whose sum is 1 during genetic algorithms optimization
lb=zeros(12,1); ub=lb+1; Aeq=ub'; beq=1;

2 years ago | 0

Answered
How to open new command window?
You can launch a new Matlab session with its own command window, but the way you are going about saving work is very peculiar. M...

2 years ago | 0

Answered
Speeding up interpolation with scattered interpolation
Your data is gridded, so you should be using griddedInterpolant, as opposed to scatteredInterpolant. Gridded interpolation is mu...

2 years ago | 0

| accepted

Answered
Why does abs cause bad matlabfunction evaluation?
It is not the matlabFunction version that is evaluating things badly. It is the first version, with the double application of su...

2 years ago | 0

Answered
Show img in coordinate system and perform transformations
I=flipud(imread('peppers.png')); T = [1 0 2 1]; T(3,3)=1; [Iw,R]=imwarp(I, affine2d(T')); h=imshow(Iw); ax...

2 years ago | 1

| accepted

Answered
Supply partially complete Jacobian for fsolve()
and let MATLAB use its own numerical methods for the missing ones? fsolve cannot be made to do finite difference calculations ...

2 years ago | 0

| accepted

Answered
Sum of following elements in array
sum_following = cumsum([s(2:end),0],"reverse");

2 years ago | 0

| accepted

Answered
How to deal with files in which rows have different numbers of columns
I think you would probably have to read the file in as a string array using readlines, and then do your own text parsing.

2 years ago | 0

Answered
plot strain ellipse and principal stress axes using eigenvalues and eigevectors.
a=10; %long axis b=3; %short axis theta=30; %rotation angle p=rotate( scale(nsidedpoly(1000),[a,b]) ,theta); plot(p)

2 years ago | 0

Answered
Intersections between two discretised functions
f = @(x) x.^2; x = linspace(-5, 5, 100); v1 = f(x); v2 = ones(size(v1)); X0=x(diff(sign(v1-v2))~=0); X=nan(size(X0)); ...

2 years ago | 1

Answered
Im trying to implement this equation in matlab
It's normally better to use FFTs for cyclic convolution, but if you insist on doing it on the non-Fourier domain, then you can u...

2 years ago | 0

Answered
exportgraphicsunusably slow and memory overruns
Try export_fig, https://www.mathworks.com/matlabcentral/fileexchange/23629-export_fig

2 years ago | 0

Answered
Plot image in 2d plain and apply operations like translation/rotation and reflection
Use imrotate, imtranslate, and flip.

2 years ago | 0

Answered
Manually modifying title position in tiledlayout environment
I was wondering if it is possible to move the title a little closer to the upper limit of the figure environment than it current...

2 years ago | 1

| accepted

Answered
Newtons Method but error message "Singular Matrix"
Landing on a point with ill-conditioned J is a hazard of plain-vanilla Newton's method. That's why people usually don't use it. ...

2 years ago | 0

Load more