Réponse apportée
why putting a variable in a matrix divide it?
It is a 2x2 matrix, even though you might not like how it gets rendered in the Command Window. If it were not really a 2x2 matri...

plus de 2 ans il y a | 0

Réponse apportée
Two functions optimization and curve fitting
Either you have a bad initial guess, or a bad model. If the latter is true, we cannot help you. If the former is true, it may he...

plus de 2 ans il y a | 0

Réponse apportée
How to replace elements of one dimension of an n-D matrix based on values in the same dimension of another n-D matrix of equal dimensions?
Possible? Yes. Advisable? Not so sure. x(:,1,:)=x(:,1,:).*(y(:,1,:) ~= 1) + 99*(y(:,1,:) == 1);

plus de 2 ans il y a | 0

Réponse apportée
Estimate different trend lines and its slopes from a set of points
This FEX download, https://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation?s_tid=ta_fx_result...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
I have to optimise an objective function within defined limits
You can set any nonlinear constraint functions that you want, though ideally it would be continuously differentiable. However, b...

plus de 2 ans il y a | 2

Réponse apportée
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...

plus de 2 ans il y a | 3

| A accepté

Réponse apportée
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)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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;...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
groupcounts and sum of data in another array in the same order
accumarray(findgroups(A(:)), B(:))

plus de 2 ans il y a | 0

Réponse apportée
groupcounts and sum of data in another array in the same order
splitapply(@sum,B,findgroups(A))

plus de 2 ans il y a | 0

Réponse apportée
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.

plus de 2 ans il y a | 0

Réponse apportée
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 ...

plus de 2 ans il y a | 0

Réponse apportée
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 ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 1

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Generating numbers whose sum is 1 during genetic algorithms optimization
lb=zeros(12,1); ub=lb+1; Aeq=ub'; beq=1;

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
Speeding up interpolation with scattered interpolation
Your data is gridded, so you should be using griddedInterpolant, as opposed to scatteredInterpolant. Gridded interpolation is mu...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Sum of following elements in array
sum_following = cumsum([s(2:end),0],"reverse");

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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.

plus de 2 ans il y a | 0

Réponse apportée
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)

plus de 2 ans il y a | 0

Charger plus