Answered
Interpolate both x and y values in Matrix to find one point
assuming the data has first dimension correspond to the Reynoid and secind dimension to yhe angle theta = [-5:2:11 20]; R = 10...

3 years ago | 0

| accepted

Answered
fitlm warns of singular design matrix when run in parfor loop, but not in a serial for loop (same data)
Could you try this: C_bigDataTable = parallel.pool.Constant(bigDataTable); % This code leads to rank-deficient design matrix w...

3 years ago | 0

Answered
Result from multiple for-Loops should go through all values
processing_time= [15 22; 8 13; 10 15]; x = optimvar('x',3,2,50,'Type', 'integer','LowerBound',0,'UpperBound',1); Constraint2 =...

3 years ago | 0

Answered
Function over a vector which involves a sum over 3D coordinates
You get 0/0 expression when abs_k is small (or 0), returning NaN. summand = (hbar^2* w_0^2 .*(abs_k.^2)*a^2.*ex_k)./(4*(ex_k-1)...

3 years ago | 0

Answered
How to convert accelometer data voltage into accleration m\s^2?
outputreading m/s² = outputreading (V)/(100 mV/g * 1e-3/9.8) = 98*outputreading (V)

3 years ago | 0

| accepted

Answered
fitlm warns of singular design matrix when run in parfor loop, but not in a serial for loop (same data)
Can you please try this code [~,bootsamp]=bootstrp(10000,[],1:height(bigDataTable)); % Generate 10k bootstrap replicates betas...

3 years ago | 0

Answered
argument in meshgrid - confused
You need to make finer grid, you meshgrid is too coarse. The version 1 is the top half of version 2. %Meshgrid Ver 1 a = -1:....

3 years ago | 0

| accepted

Answered
How to index the matrix only the first dimension of the rest
A = rand(2,3,4,5); C=repmat({':'},1,ndims(A)-1); % C=repmat({:},1,100); if you don't want to be depend on A B = A(1,C{:});

3 years ago | 1

Answered
Connecting dots with spline or polinomial on an image to process it later
Using Free knot spline available here https://uk.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation ...

3 years ago | 0

Answered
Selection of subsets from two arrays to an array consisting only of unique values
There is no false or duplicate intermediate combination in this code: A = ['a','b','b','c','d','e'] B = ['a','a','d'] n = ...

3 years ago | 0

| accepted

Answered
Is there a Faster alternative to containers.Map function ?
I would use array/string array/cellarray because in your case the number of keys is limited and you can enumerate them wih reaso...

3 years ago | 0

| accepted

Answered
Parallel rank calculation for sparse matrices -- suggestions?
Something I don't get : sprank doc tells when you run witth threadpool it runs in parallel.

3 years ago | 0

| accepted

Answered
how to expand a Square matrix and reverse to its original form ?
Not fully check: original=[1 2;3 4] n = size(original,1); A = reshape(original,[n 1 n 1]); A = repmat(A,[1 n 1 n]); [I,J]...

3 years ago | 1

Answered
I want to shift vector values one by one to the left
May be this? num = [1 1 0 1 0 1 0 1 0 0]; j = find(num); m = length(j); J=repmat(j,m,1); for i=m:-1:1 J(m-i+1:end,i) =...

3 years ago | 0

Answered
I want to shift vector values one by one to the left
Is it what you want? num = [1 1 0 1 0 1 0 1 0 0]; j = find(num); m = length(j); l = (-m+1:0)+(length(num))-j; q = sum(l)+1;...

3 years ago | 0

Answered
Sum selected columns of a matrix
Another approach A = [0.0486947932834768 0.590504451038576 0 0.0579865082127525 0.0490083905415712 0.672222222222222 0 0.094862...

3 years ago | 0

Answered
Finding Congruencing Matrix between two given matrices
Partial solution: if A and M are real symmetric or complex Hemitian, the P can be computed as [W,E]=eig(M,'vector'); [V,D]=ei...

3 years ago | 0

Answered
flag if plot Intersects itself
I gave an answer to a similar question here https://fr.mathworks.com/matlabcentral/answers/1759440-looking-for-where-line-inter...

3 years ago | 0

| accepted

Answered
How to find '1' for the second time in a matrix by row wise
A = [ 0 0 1 0 0 0 0 0 1 1 0 0; 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 1 0 1 0]; At = A.'; [col2n1,row]=find(cumsum(At)==2 ...

3 years ago | 1

| accepted

Answered
Fill up submatrix along third dimension with two dimensional matrix
x(1:2,1:2,:) = repmat( [1 2; 3 4], 1, 1, size(x,3)); I would love to have MATLAB indexing to behave with auto expansion, but pr...

3 years ago | 0

| accepted

Answered
Parameter covariance from lsqnonlin when using Jacobian Multiply function?
A low rank approximation of H=inv(J'*J); is using svds r = 10; [~,S,V]=svds(J,r,'smallest'); r = size(S,1); % == 10 s = di...

3 years ago | 0

Answered
How to delete repeating value in a row ?
a = [1 2 2 4 4 2 2 1 1 4 4 ] b = a([true diff(a)~=0])

3 years ago | 0

| accepted

Answered
filtfilt Does Not Perform Zero-Phase Filtering. Does It Matter?
In the theory of linear filter, there is no such thing as start/stop, the signal extend to infinity in both ends. The definitio...

3 years ago | 1

Answered
A problem in official website 'Least-Squares (Model Fitting) Algorithms'
I think more like ... f(xk + dk) < f(xk) holds true

3 years ago | 0

Answered
How to get the coordinates inside the polygon
Use polyshape class or https://www.mathworks.com/help/matlab/ref/inpolygon.html Pass the coordinates of the pixels to this fun...

3 years ago | 2

Answered
parallel sum different from serial sum
Consider this example of the sum of three numbers in different order: (Your parallel change the order of the sum compared to no...

3 years ago | 2

Answered
Comparing two numerical arrays
Checkout discretize secondarray=[0,3,7,10] firstarray=randi([1 10],1,20) thirdarray=discretize(firstarray,secondarray,'Incl...

3 years ago | 1

| accepted

Answered
I am using Curve fitting for two unknown variables. While I am running the program it is displaying some error. Function is shown in below
Y=1-(1-(X).^B).^A Such expression returns complex value X < 0, or (1-(X).^B) < 0. Make sure your code avoid or can deal with s...

3 years ago | 0

Answered
Modifying the search path is not supported by matlab compiler
That's right. It's a constraint of the compiled app that you cannot do anything.

3 years ago | 0

Answered
Why does a for loop iterate over an empty column vector?
Yes this is expected. The for-loop iterates on the number of columns of an array, regardless the number of row for c = A ...

3 years ago | 1

Load more