How to eliminate the elements in an array from another array when there are repeated elements in both arrays?
A = [ 1,2,2,2,3,4]; B = [1,2,2,3]; Au=[unique(A),inf]; reps=max( histcounts(A,Au)-histcounts(B,Au) ,0); C=repelem(Au...

9 days ago | 0

Restricting solutions using lsqnonlin with complex unknowns
l1,L2,L3 are complex numbers, where the real and imaginary part are two sepparate unknowns, If so, then you have 12 unknowns, ...

9 days ago | 0

| accepted

Incorrect lsqcurvefit fitting, stays in initial guess
xdata =[2.00E-05 2.45E-05 3.00E-05 3.70E-05 4.55E-05 5.55E-05 6.75E-05 8.25E-05 1.01E-04 ... 1.24E-04 1.51E-04 1.85E-04 2.2...

9 days ago | 0

| accepted

how to find a normal vector?
In my case, P1 point wil be the V0 and P1 for this function. You need 3 distinct, non-colinear points in a the plane to calcula...

10 days ago | 0

| accepted

How to have elementwise multiplication expand in two dimensions?
C=A.*reshape(B,[16,16,3,1,7]); C=reshape(C,[16,16,3,700]);

10 days ago | 1

| accepted

Can I disable intermediate calculations for fmincon
Since you are specifying the objective gradient, finite difference calculations will not be executed for that particular piece o...

10 days ago | 0

| accepted

How to vertically concatenate certain fields of a structure on each pass of a loop?
clear results for k=numel(files):-1:1 ..... data=pulldata(filename); results(k)=analyzedata(data); end ...

11 days ago | 1

string matrix navigation with character string
DataSour = ["Do" "Ri" "Mi"; "AA" "VV" "Fa"; "SS" "BB" "Do"; "Do" "yy" "zz"]; ToAssign = "Do"; [ColPos,RowPos]=find(DataSour'...

18 days ago | 0

Eig takes too long
Does anyone have any suggestions or advice that can help speed up this calculation if that is even possible? I don't think the...

18 days ago | 0

parabolic fit and extend upwards in 4 points
Use polyfit.

18 days ago | 0

How to resolve : increase max function value in fitting using fminsearch?

18 days ago | 0

How to resolve : increase max function value in fitting using fminsearch?
You could do as the message says and increas MaxFunEvals, but for your model, it would be better to download fminspleas, https:...

18 days ago | 0

| accepted

Calculation of the surface area of a generic solid
One way might be to read the stl file into a triangulation object using stlread. With the triangulation object, you can use free...

18 days ago | 0

Removing all elements from a struct field
[aap.acq_details.sessions.name]=deal([])

21 days ago | 0

Concatenate into a matrix is not saving and is overriding every iteration?
Ns=numel(subjs); Nt=numel(time); percent_change=cell(Ns,1); for s = 1:Ns subj = subjs{s}; for i = Nt:-1:1 ...

21 days ago | 1

| accepted

How to create transformation matrix
You wouldn't use a transformation matrix to execute a deformation like that. You would just use griddedInterpolant or interp3 to...

21 days ago | 0

Revolving a 2D plot around its vertical axis to generate 3D surface

21 days ago | 0

| accepted

How to pass from a set of points to lines interpolating them?
Image=load('codice_opcode.mat').out; B=bwboundaries(Image); B(1)=[]; imagesc(Image); colormap(gray); axis image; hold on...

22 days ago | 0

| accepted

How to group logical numbers in a vector?
Use this: https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors ...

22 days ago | 0

| accepted

Cycle for to save a matrix
[nr,mr]=size(Range_compression); [time_compression,range_compressed]=deal(nan(nr,mr)); for i=1:mr [time_compression(...

24 days ago | 0

| accepted

Find pattern in vector while ignoring/skipping certain indices
vec=[0 4 1 0 6 5 0 8 7, 3 3 3 , 0 4 2 0 6 4 0 8 6]; %patterns start at i=1 and i=13 pat = [0 4 nan 0 6 nan 0 8 nan]; ...

24 days ago | 0

How do I convolve a periodic rect function with comb function

24 days ago | 0

How do I convolve a periodic rect function with comb function
X=1; Y=2; rect=@(s) 0<=s & s<=1/2; r=@(s) rect(mod(s+1/4,1)); [x,y]=meshgrid(-3*X:0.01:+3*X, -3*Y:0.01:+3*Y); P=r(x/X).*...

24 days ago | 0

| accepted

Multiple toolboxes with lots of redundant features?
The issue you've raised would only be a problematic one if it somehow forced people to buy more toolboxes than they should need....

25 days ago | 0

How to plot the following surface
fsurf(@(x,y) sqrt(x.^2+y.^2)+1, [-3 3 -3 3] ) zlim([1,3])

25 days ago | 1

| accepted

How to plot the following surface
fimplicit3(@(x,y,z) (z-1).^2-x.^2-y.^2, [-3 3 -3 3 1 3] )

25 days ago | 1

Sum elements over indices in cell array
Once you've split things into cells, there is nothing faster than a loop. The better data organization would be to use group lab...

25 days ago | 0

| accepted