Answered
Can't integrate exponential function
%syms x - doesn't belong here myFunc = @(x) (exp(x)./x); %use ./ y = integral(myFunc,3.5,4.5)

5 years ago | 0

| accepted

Answered
Fitting a curve as defined by a file, for the integral value
Your Fitfile doesn't match the model previously described y = a*exp(-x./b)+c so I'm not sure which one is supposed to be correct...

5 years ago | 0

Answered
how to scale fft?
The DFT is a tool for computing several other theoretical transforms. It can be used to compute a Discrete Fourier Series, whic...

5 years ago | 0

| accepted

Answered
Finding neighbors in pages of very large 3D matrix
kernels={[1 1], [1;1], eye(2), fliplr(eye(2))}; counts=0; for i=1:4 map = convn(binary_3D,kernels{i},'valid')==2; ...

5 years ago | 0

Answered
i am dealing with gradieent descent based minimization problem , my matrix is heavily ill conditioned , leading to false recovery in forward inverse problem
Try Newton's method instead of steepest descent. If you have the Optimization Toolbox, fminunc() basically has Newton-like meth...

5 years ago | 1

| accepted

Answered
Is there a way to count the integers in a matrix that fall within a certain range?
Yes, you can use histcounts. counts=histcounts(yourMatrix(:),[0,20,40,60])

5 years ago | 1

Answered
How to Find Multiple Minima of Objective Function from Genetic Algorithm?
You can call ga() with more output arguments to obtain the final population and their scores, [x,fval,exitflag,output,populatio...

5 years ago | 0

Answered
how to deconvolute a matrix?
I would like to deconvolute a matrix but i didn't find a 2d deconvolution function. See deconvreg(), deconvlucy(), deconvbli...

5 years ago | 1

Answered
Issue with tiledlayout and axes properties
I would do something like this. It gives me no trouble with repeat runs. Names={'F1.fig','F2.fig'}; figure; tc=tiledlayout(...

5 years ago | 0

Answered
Linear approximation that goes through zero
Here's a simple example. x=-5:5; y=2*x+randn(size(x))*0.4; slope=x(:)\y(:); yapprox=slope*x; plot(x,y,'o',x,yapprox);

5 years ago | 0

| accepted

Answered
Cant solve simultaneous trignometric equation with 3 unknowns by solve()
Likely, there is more than one solution. You can subsititute the values that vpasolve() gave you into the original equations to ...

5 years ago | 0

Answered
Plotting a line, but the line is like a piecewise function
hdata=linspace(0,110000,1000); Tdata=arrayfun(@Temperature,hdata); plot(hdata,Tdata, 'o') function T = Temperature(...

5 years ago | 0

| accepted

Answered
Extract indices from other matrix corresponding to the minimum
Mat = rand(30,2); X = rand(30, 3, 2) ; [~, min_idx] = min(Mat, [], 2, 'linear') ; Xp=reshape( permute(X,[1,3,2]),[],3)...

5 years ago | 0

| accepted

Answered
How to define the frequency domain for plotting the FFT?
To better explain my point: imagine if the fft() function returned a frequency vector over which it was calculated: The frequen...

5 years ago | 2

Answered
how can i make a 400x400 matrix to 400x1
Many ways, e.g., sum(rand(400),2)

5 years ago | 0

Answered
Faster way than 'switch-cases' to run a specific function depending on the value of a variable?
F={@function1, @function2,@function3}; function out=dummy(a,F) F{a}(); end

5 years ago | 0

| accepted

Answered
For loop to create a matrix array
Because, I may need to create matrix of size 9 by 5. In which case I will only have 2 matrices formed from the first 90 elements...

5 years ago | 1

| accepted

Answered
Calculating multiple function variables and storing in a matrix
w=[1,2,3]; Mag = 1./sqrt(1+(1./(w.^2.*(10)))) plot (w,Mag)

5 years ago | 1

| accepted

Answered
Solving a system of equations by transforming least squares into left division
H = [ x.^3 x.^2 x.^1 x.^0 ]; %Descending powers is more convenient beta_ols = H\y; y_fit = polyval(beta_ols,x);

5 years ago | 1

| accepted

Answered
How to find coefficients of a polynomial (linear and non-linear parts) incl. given values of the function
For the model function you've shown, I'd recommend, https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas This...

5 years ago | 0

Answered
Why is subscripted assignment so inefficient?
I would guess it's only because you are using 3 subscripts on an array that only has 2 dimensions. This forces Matlab to to do e...

5 years ago | 0

| accepted

Answered
How to find maximum point-to-plane distance for plane fitting in 3D model ?
You choose maxDistance based on what you would consider an outlier. Any point that is further from the fitted plane than maxDist...

5 years ago | 1

Answered
how to deconvolute a matrix?
Using https://www.mathworks.com/matlabcentral/fileexchange/44669-func2mat-convert-linear-function-to-matrix a=randi(2,3); b=r...

5 years ago | 0

| accepted

Answered
Is there a way to provide a vector of unknown coefficients to MATLAB's fittype function for non-linear least squares?
It would be better to use lsqcurvefit() for such a problem. With lsqcurvefit(), you can specify the unknown coefficients in vect...

5 years ago | 0

| accepted

Answered
Find complex roots of homogeneous matrix equation
Just loop over the discrete s until you find where det(Z) is sufficiently close to zero.

5 years ago | 0

Answered
Cannot replicate results of nonlinear optimization w/ nonlinear constraints from replication files
when I attempt to simply re-run the last iteration of the fixed-point algorithm You wouldn't be able to re-run the last iterati...

5 years ago | 0

Answered
Finding Definitess of a Matrix
You alread have code that checks if a is postive (semi) definite. You can use that to see if -a is positive (semi) definite, whi...

5 years ago | 0

Answered
why fft (exp(-t)) don't fit my analytique expression?
dt=0.001; t=-5:dt:5; N=numel(t); f= t/N/dt^2; h_t=exp(-t).*(t>=0); %<---- truncate to zero for t<0 h_f1=fftshift(ff...

5 years ago | 0

| accepted

Answered
I want to find multiple zeros from a function.
Youc annot make fzero find multiple roots in a single call. However, you can call it multiple times and ask it to search differe...

5 years ago | 0

Answered
Help defining normalized SSE for problem based objective function
add this in and run the script, I'm getting an error for the argument dimensions must agree. Well, we have no idea what you've ...

5 years ago | 1

Load more