Answered
Speeding up a slow running optimisaton problem
Don't use the problem-based framework when speed is critical and don't repeat unnecessary commands inside the loops. N=size(S,...

5 years ago | 0

Answered
How to split 128x128 array into 64 ( 2x128 ) ?
Download mat2tiles from https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-...

5 years ago | 0

Answered
Calculation with for loop saving the output in separate variables
This is how you should do it: A=[2 2; 1 3]; x=[0.5; 1]; x=x/max(x); n=5; B=cell(1, n); B{1}=A*x; for i=2:n B{i...

5 years ago | 0

Answered
Restore toolbar buttons to app after migration from GUIDE
Mathworks Tech Support claims this has been fixed in R2020b.

5 years ago | 0

Answered
Find repeating line in matrix
Using https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors start...

5 years ago | 0

| accepted

Answered
Using a variable vector in a loop
You should not use the classical Gram-Schmidt procedure, as it is numerically unstable. Use orth() instead.

5 years ago | 1

Answered
How can I insert a bunch of 6x6 matrices into a larger 30x30 matrix?
Example: A=zeros(30); A(1:6,1:6)=reshape(1:36,6,6)

5 years ago | 0

Answered
If I want to plot like this, what codes do I have to use??
The stairs() or bar() command.

5 years ago | 0

| accepted

Answered
How to solve for x give the equation of a circle and the equation of a line?
If you have the Symbolic Math Toolbox syms x y sol=solve((x-2)^2+(y+3)^2==4, 2*x+2*y==-1); double( sol.x ) double( sol.y...

5 years ago | 1

| accepted

Answered
Vectorized iterative summation of matrices
c=conv2(a,rot90(b,2),'same');

5 years ago | 4

| accepted

Answered
Least squares solvers - Optimization Toolbox
The only difference between the two solvers is the input syntax. lsqcurvefit has the more convenient syntax when the residuals a...

5 years ago | 0

| accepted

Answered
I'm getting error as "First argument must be scalar" while finding roots of a 8 degree poynomial
You have 2 problems. First, you are trying to find analytical expressions for the roots of an 8-degree polynomial, which is mat...

5 years ago | 0

| accepted

Answered
Reshaping a matrix with binary numbers
can I do in with reshape function? Sure, along with some transposes. Those would be avoidable if you stored your data column-wi...

5 years ago | 0

| accepted

Answered
Documents on computer vision toolbox matrix convention
It mostly means that instead of transforming coordinates with left matrix multiplication y=A*x, you would instead do y=x*A.'

5 years ago | 0

Answered
How do i create a system of matrices from a single matrix?
H=cell(1,n); H{1}=A; for k=2:n H{k}=A*H{k-1}; end

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

| accepted

Load more