a problem with setting fmincon options?
I would guess that you entered your options object as the 9th input argument to fmincon when it really should be the 10th. If yo...

11 giorni ago | 0

| accepted

set Precision in lsqcurvefit
You cannot do such a thing with lsqcurvefit. What you describe would require that you rewrite your objective function and bounds...

11 giorni ago | 2

Delete part of an image

11 giorni ago | 2

| accepted

Find the orientation of the skeletonized image
You can use houghlines to get the endpoints of all the line segments in the image. From that, you can easily calculate their slo...

11 giorni ago | 0

Using cell array to define Argument list in function Handle
That is not the right approach. You should be taking advantage of the fact that this is Matlab, and that your variables are allo...

12 giorni ago | 0

Divide plane into two separate planes
Let b1 and b2 be basis vectors for the plane and let x0 be a point in the plane. Then, for example, x0(:) + b1(:)*randn(1,N) + ...

12 giorni ago | 0

| accepted

how to plot values that only fall within a range?
KPH_70 = mean(Y(FVY)); yyaxis left plot(X(FVY),Y(FVY)); yyaxis right plot(X(FVY),KPH_70*ones(size(FVY)));

12 giorni ago | 0

| accepted

How to pass a vector to a function that creates matrix
>> b=[1 2 3]*10; >> T=@(i) [b(i)+9 , 8 ; 8 , 7 ]; >> T(3) ans = 39 8 8 7

12 giorni ago | 0

how to calculate direction in rotated coordinate system

13 giorni ago | 0

How to work with Nelder-Mead algorithm with 7 unknown variables?
You can use fminsearch (an implementation of Nelder-Mead) with any number of variables. However, there is no way to gaurantee th...

13 giorni ago | 2

f(x)=sin(x)-x^5=0 providing x is not equals 0 ,function in the interval x [0,3]
>> [x0,fval]=fzero(@(x)sin(x)-x.^5,[0.8,1]) x0 = 0.9610 fval = -1.1102e-16

13 giorni ago | 0

| accepted

Generating Toeplitz Matrix which Matches the Convolution Shape Same
Using interpMatrix (Download), nH=numel(vH); nX=numel(vX); ic=ceil( (nH+1)/2); mH = interpMatrix(vH,ic , nX,1);

13 giorni ago | 0

Generating Toeplitz Matrix which Matches the Convolution Shape Same
I am specifically asking about using the function toeplitz(). If it must be with toeplitz, then: nH=numel(vH); nX=numel(vX); ...

13 giorni ago | 0

| accepted

Concatenating matrices in a file into another matrix
For example, >> p1=[1,2,3]; p2=[4 5 6]; p3=[7 8 9]; save p p1 p2 p3 >> A=cell2mat(struct2cell(load('p'))) A = 1 ...

13 giorni ago | 0

| accepted

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.240406e-24.
Even with A\B, you cannot expect reliable behavior with RCOND as small as 2.240406e-24. For all intents and purposes, your mat...

13 giorni ago | 0

Fit a conic section without mirror image hyperbola
This approach uses John's fminspleas FEX submission (Download). Although the fit is, technically, a hyperbola, it diverges to a ...

13 giorni ago | 1

rotating and saving images to folder: error during loop
The code works fine for me. If I had to guess, I would say it is because you ran the code previously while debugging and never c...

13 giorni ago | 0

Defining constraints in the Quadratic Programming
If you have a quadratic function of only 1 unknown variable, it should be possible to find the minimum analytically - no iterati...

13 giorni ago | 0

The code looks suspiciously like an attempt at weighted normalized cross-correlation. If so, see here for a possibly faster alte...

14 giorni ago | 1

Forming a block diagonal matrix of one certain matrix?
using interpMatrix (Download) S=1*ones(2); B=2*ones(2); C=3*ones(2); copies=4; %number of repetitions L=flip( {S,B,C, z...

14 giorni ago | 0

Generating Toeplitz Matrix which Matches the Convolution Shape Same

14 giorni ago | 0

Fast method to find average pairwise distance of a very large matrix?
I don't know about the mean distance, but the mean squared or root mean squared distance is pretty easy. Compare: A=rand(330000...

17 giorni ago | 0

Creating a Random Upper Triangular Matrix with Unique Entries for Efficiently Computing Matrix Exponential.
Just use randi, e.g., >> k=8; M = triu(randi(10,k,k)) M = 9 10 5 7 3 5 8 10 0 10 ...

17 giorni ago | 0

How can I extrapolate the value for the slope of the line?
You could do, p=polyfit(log(x),log(y),1); slope=p(1);

17 giorni ago | 0

| accepted

How to store sequence of bits as a bit stream and use the least possible memory ?
You could chain all your strings together as a logical column vector and use bwpack, see https://www.mathworks.com/help/images/...

17 giorni ago | 0

calculate rotation matrix in 3D
B1=[axis_1/norm(axis_1);axis_2/norm(axis_2);axis_3/norm(axis_3)]; B2=[dir1_new(:),null(dir1_new)]; s=sign(det(B2)); B2=...

17 giorni ago | 0

How to I convert a 3D array into 4-column table (x y z value)?
[m,n,p]=size(imgData); [x,y,z]=ndgrid(1:m,1:n,1:p); out=[x(:),y(:),z(:),imgData(:)];

18 giorni ago | 0

| accepted

Correct Interpolation on a pre-calculated grid that is a vector function of a vector?
so that I can query at points (Gx_q, Gy_q, Gz_q) and find their (x,y,z) inputs that give G. But there may exist no such point ...

18 giorni ago | 0

interp1 gpuArray bug
The bug appears to have been fixed in R2019b: >> A=rand(80,2); >> interp1((1:80)', A, gpuArray(((1:2))')) ans = 0.60...

18 giorni ago | 0

| accepted