Réponse apportée
How to perform mathematical operation of arrays inside loop?
for i=1:N E=B-A*X; if norm(E,1)<1e-40, continue; end C=E.^2; X=lscov(A,B,1./C); end...

environ 3 ans il y a | 1

Réponse apportée
Why there is a large numerical error in simple arithmatics?
You need to look at the relative errors. You will see that they are super-small: x = rand(1,1); x_1000 = x*1000; N = -20 : ...

environ 3 ans il y a | 0

Réponse apportée
fsolve no solution found results
Is the output the last iteration or does it output the initial conditions? It is the last iteration, as you can easily test, .e...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
fmincon sometimes returns "incorrect number of elements of objective gradient" error.
My best guess is that the MaxFunctionEvaluations limit was reached midway through finite differencing operations needed to compl...

environ 3 ans il y a | 0

Réponse apportée
non linear regression problem. fitnlm gives error
Your model function can easily generate NaN's and Infs because with fitnlm there is nothing to bound the b parameters (see below...

environ 3 ans il y a | 0

Réponse apportée
Defining normal unit vector for arbitrary plane surface in 3D space
Use planarFit() in this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitt...

environ 3 ans il y a | 0

Réponse apportée
How can i get the smallest shape using a list of centroid coordinates?
You can use bwalphaclose from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-a...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Plotting the vertex based hexagon hierarchical structure.
P=rotate(nsidedpoly(6,'SideLength',1),30); %1 hexagon plot(P,'FaceColor','none'); axis equal P=fcopy(P,sqrt(3)*[1,0], 0:7 ...

environ 3 ans il y a | 0

Réponse apportée
Creating 3D efficiency map using interpolation.
torque=torgue; F=scatteredInterpolant(speed(:),torque(:), efficiency(:)) Now use F to query the points you want as explained...

environ 3 ans il y a | 1

Réponse apportée
Finding a set of easily distinguishable local minima quickly and algorithmically.
load matlab y=im_mean(:); x=(1:numel(y)).'; k=(y==movmin(y,21)); plot(x,y,'-', x(k),y(k),'ro'); legend('Signal','Local...

environ 3 ans il y a | 0

Réponse apportée
How to plot an in-ellipse(ellipse inside an object) which also matches the object orientation.
a=5; b=3; %axes lengths theta=40; %rotation angle x0=1;y0=2; %center fcn=@(p) translate( rotate( scale(p,[a,b]), theta),...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Trouble using Curve Fitter tool
I am not sure I understand what you mean regarding apparent singularities in my x,y data. If beta+k2*x=0 or delta+k4*x=0 then y...

environ 3 ans il y a | 0

Réponse apportée
fmincon non-linear optimisation: issues with sqp and interior-point
SQP...Basically, it lacks the tools to make a step back when overshoots On the contrary, it is one of the few algorithms that c...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to find the value in one column based on a value of a another column.
% Generate example data time = (0:0.1:1)'; pressureA = 20*sin(time/3); pressureB = 20*sin(pi*time/4); pressureC = 20*sin(p...

environ 3 ans il y a | 0

Réponse apportée
fitting data with a combination of exponential and linear form ( a*exp(-x/b)+c*x+d )
If you download fminspleas, you can get a pretty good fit with a fairly naive initial guess [b,e,f]=[-1,0,0]: [x,y]=readvars('d...

environ 3 ans il y a | 2

Réponse apportée
How can I use datacursormode in app designer?
Yes, it's an unfortunate deficiency, and one of the main reasons I'm still using GUIDE. One workaround is to make an additional ...

environ 3 ans il y a | 0

Réponse apportée
How can I fit a curve at the bottom of the plot below?
You can use boundary, y=readmatrix('data.txt'); x=(1:numel(y))'; k=boundary(x([1:end,1]), y([1:end,1])); k=k(diff(k)>0); ...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Cutting everything above an intersection of two elipses
Just use min(). Example: x=linspace(-3,3); y1=(x-1).^2; y2=(x+1).^2; figure; plot(x,y1,'--r',x,y2,'--r'); ylim([0,4]) ...

environ 3 ans il y a | 1

Réponse apportée
When a global variable is justified
To fix this, I would need to intorduce an additional input variable in all definitions and calls. No, you could add the debug f...

environ 3 ans il y a | 1

Réponse apportée
Fittype with anonymous function of multiple parameters and variables
alpha=1; beta=2; ft0 = fittype( @(gamma,x,y) exp(-(alpha.*x+beta*x.^2)).*exp(-(gamma*x.*y)),... '...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to subtract false color gradient ?
detrend() operates column by column. I suspect you can avoid the lines by subtracting a plane fit to the whole surface instead, ...

environ 3 ans il y a | 0

Réponse apportée
Create square marix of values for a 2 variable function.
x= 0:0.01:100; y=(0:0.01:100)'; f=cos(x)+sin(y)

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Page-wise Diagonalization?
A=rand(4,1,3); pagetranspose(A) [n,~,p]=size(A); B=zeros(n^2,p); B(1:n+1:end,:)=reshape(A,n,p); B=reshape(B,n,n,p)

environ 3 ans il y a | 1

Réponse apportée
Plot 2D images into 3D cylindrical image
Each slice of the 3D image can be obtained by using 2D scattered interpolation of the radial samples formed by the 2D images.. U...

environ 3 ans il y a | 0

Réponse apportée
Calculation of the volume of a convex polytope as a function of indeterminate parameters
I don't know if the computation is tractable, in light of what John said, but here is code that will attempt it using the FEX do...

environ 3 ans il y a | 1

Réponse apportée
To make smaller hexagons at the points marked with cross in black
Forming the hexagons is easy enough using nsidedpoly (see below), but you need to use the delaunay triangulation to determine wh...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
scatteredInterpolant: what is linear interpolation in 2d?
No, the support points are being divided into triangular elements, not rectangles. It is puzzling that you would be using scatte...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Displaying MATLAB tables wrapped
One possibility, TBL=array2table(rand(4,12)); wrapit(TBL) function wrapit(T,ncols) if nargin<2, ncols=7; end M=c...

environ 3 ans il y a | 0

Réponse apportée
Calculating distance between 2 curves
If you are trying to find the intersections of the magenta lines (extended to infinity) with the red curve, then this might help...

environ 3 ans il y a | 0

Réponse apportée
Fmincon finds different solutions for optimization problem in dependance of initial values
You might find it easier to reach a good solution if you simplified the implementation of your constraints. In particular, your ...

environ 3 ans il y a | 0

Charger plus