Answered
how can I have a perfect rect function as the result of applying fft on sinc function?
I want exactly a rectangle like what we have in theory. The FFT of a sinc function is not a perfect rect, even in theory. The ...

9 dagen ago | 1

Answered
Plotting from function per for-loop iteration
If you want new figure windows for each plot, don't specify a number for them: figure scatter(x,y) figure scatter(x+y,y)

10 dagen ago | 1

| accepted

Answered
How to find intersection points of multiple line segments in 3D?
If you generate them randomly, they will not intersect. However, generatig and plotting them is no problem, numlines=5; for ...

10 dagen ago | 0

Answered
matlab function on a grid along third dimension
No, you can't. However a 3x3x3 array is too small for a loop to suffer any serious penalties.

10 dagen ago | 0

Answered
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...

10 dagen ago | 0

Answered
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, ...

11 dagen ago | 0

| accepted

Answered
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...

11 dagen ago | 0

| accepted

Answered
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...

11 dagen ago | 0

| accepted

Answered
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]);

12 dagen ago | 1

| accepted

Answered
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...

12 dagen ago | 0

| accepted

Answered
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 ...

13 dagen ago | 1

Answered
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'...

20 dagen ago | 0

Answered
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...

20 dagen ago | 0

Answered
parabolic fit and extend upwards in 4 points
Use polyfit.

20 dagen ago | 0

Answered
How to resolve : increase max function value in fitting using fminsearch?
If you have the Curve Fitting Toolbox, [x,y]=readvars('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1034515/d...

20 dagen ago | 0

Answered
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:...

20 dagen ago | 0

| accepted

Answered
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...

20 dagen ago | 0

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

22 dagen ago | 0

Answered
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 ...

22 dagen ago | 1

| accepted

Answered
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...

22 dagen ago | 0

Answered
Revolving a 2D plot around its vertical axis to generate 3D surface
https://www.mathworks.com/matlabcentral/answers/1716995-revolving-a-curve-about-the-y-axis-to-generate-a-3d-surface#answer_96206...

23 dagen ago | 0

| accepted

Answered
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...

24 dagen ago | 0

| accepted

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

24 dagen ago | 0

| accepted

Answered
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(...

25 dagen ago | 0

| accepted

Answered
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]; ...

25 dagen ago | 0

Answered
How do I convolve a periodic rect function with comb function
Another possibility is to download interpMatrix https://www.mathworks.com/matlabcentral/fileexchange/26292-regular-control-poin...

26 dagen ago | 0

Answered
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).*...

26 dagen ago | 0

| accepted

Answered
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....

26 dagen ago | 0

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

26 dagen ago | 1

| accepted

Load more