convolving signal and noise in frequency domain and inverting back to time domain
sig_ns_conv = (ifft(fft(sig) .* fft(noise))) * dt;

4 days ago | 0

| accepted

To minimize a function
The Optimization Toolbox, https://www.mathworks.com/products/optimization.html and the Global Optimization Toolbox, https://...

4 days ago | 1

| accepted

Infinite recursion when saving a custom object
It happens because save() does know that the parent and child properties are supposed to be references to one another. It tries ...

4 days ago | 0

| accepted

How to generate random graph of n vertices with random connections with specified number of Edge in matlab
n=5; %number of nodes e=10; %number of edges T=table(randi(n,e,2),'Var',{'EndNodes'}); G=graph(T); plot(G)

4 days ago | 0

| accepted

Troubles with Plotting Across 3rd Dimension of a 3D Matrix
I would do it this way. A=permute(yourStack,[3,1,2]); A=A(: , any( A(:,:) , 1) ); plot(A)

5 days ago | 0

| accepted

Simple for loop taking way longer than it should
I don't see why it would be slow, but there's no need for a for loop at all, regularizedData.peak(2:end-1) = regularizedData.vm...

5 days ago | 0

| accepted

vectorisation of a loop
I find this version to be about 30% faster: S = size(Sea,1); i = 1; t=0.05^2; while i < S ...

5 days ago | 0

How can I produce new coordinates for one dimension if a matrix and interpolate to these new coordinates?
INTERP1 would be sufficient here. depthFehmarn=unique(depthFehmarn); xq=linspace( depthFehmarn(1) , depthFehmarn(end) , new...

6 days ago | 0

How can I produce new coordinates for one dimension if a matrix and interpolate to these new coordinates?
depthFehmarn=unique(depthFehmarn); xq=linspace( depthFehmarn(1) , depthFehmarn(end) , newpoints); F=griddedInterpolan...

6 days ago | 0

Is it possible to use previous estimated values to improve fmincon's efficiency?
If you expect the solution of the new problem to change only slightly as compared to the previous problem, then you can use the ...

6 days ago | 0

Fsolve Intemidiate equations result
After solving, you can simply use the objective function that you have already written to obtain these values: [a_vih, fval] = ...

6 days ago | 0

How can I merge a 3 column numeric matrix into a single column cell array?
A=[10 20 30; 10 25 35; 10 30 35; 10 35 40; 10 45 50]; num2cell(A,2)

7 days ago | 0

| accepted

Solving nonlinear equation inside for loop
Your equations are really polynomials in p^0.5. Therefore, you can do, a1=1.4*10^25; a2=2.7*10^24; a3=1.311*10^23; k=linspac...

7 days ago | 0

| accepted

imgaussfilt asymmetry as a linear operator
(b) given that it is unsymmetric, how I can obtain its adjoint operator. In the asymmetric case, a brute force solution would b...

7 days ago | 0

imgaussfilt asymmetry as a linear operator
It is because of edge effects. If you add sufficient zero padding you will see symmetric behavior.

7 days ago | 0

| accepted

Expected one output from a curly brace or dot indexing expression
The issue you are seeing has nothing to do with mat files. The expression that you've shown can only work if n is a scalar.

7 days ago | 0

Entering data into cell array
noble_gases{1,1}="Hydrogen"; noble_gases{1,2}="H"; etc...

7 days ago | 0

Sum matrix column orderly
B=conv2(A,ones(15,1),'valid').';

7 days ago | 0

Transformation matrix (projective2d) change of origin at application
You should use imwarp's OutputView option to specify a coordinate system for the output with the origin in the center.

7 days ago | 0

Plotting ellipses around the data points and circle around the cluster points
At the very end of the the Examples tab of https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for...

7 days ago | 0

| accepted

How do I get values of a certain parameter in a multi-dimensional matrix?
b should be an Nx1 vector where N is the number of elements satisfying A<10000.

7 days ago | 0

Wrong ROI Ellipse rotation angle documentation?
In the coordinate conventions of the Image Processing Toolbox, the Y-axis points downward and the Z-axis is pointing into the sc...

7 days ago | 1

| accepted

vectorisation of a loop
[m,n]=size(Sea); D=pdist2(Sea,Sea); D(1:m+1:end)=inf; indices=any(triu(D<0.05),1); Sea(indices,:)=[];

7 days ago | 0

How can I assign a single column of a 0x10 empty table
I cannot use a struct or array. The datatype must remain as a table. You cannot avoid wokring with arrays as an intermediary, ...

8 days ago | 0

Find longest consecutive sequence in 3d matrix
Using, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors [M,...

8 days ago | 0

| accepted

Find argmin of function with two input variables
MATLAB keeps returning Empty sym: 0-by-1 and I don't understand why. Any help? The solution to diff(La,x1)==0 is x1 = -0.5, whi...

8 days ago | 0

| accepted

Does the code run on the GPU after transferring data to the GPU using the gpuArray function？
Any operations you do on a gpuArray object will be done on the GPU. Operations you do on other objects (not gpuArrays) will be e...

8 days ago | 0

I cannot figure out how to fix this error "Objective function is returning undefined values at initial point. fsolve cannot continue."
I suspect you meant to have 6 values in x0 rather than 7. x0=[1,1,1,0.02,0.02,0.02];

9 days ago | 0

How to apply an equation to each element in the array?
conv( u , [0 1 0]+alpha*[1 -2 1] )

10 days ago | 1

| accepted