Answered
How can I derive inverse of the matrix with infinite determinant?
Welcome to the world of numerical calculation. Every conclusion you made is wrong. "det(A) = Inf Therefore, it cannot compute t...

2 månader ago | 3

Answered
How to fill a vector and change its elements when reaching a specific element?
x = zeros(1, 3600); x(1) = 0; dx = 20; for k=2:length(x) xk = x(k-1) + dx; if xk > 1000 dx = -20; ...

2 månader ago | 0

| accepted

Answered
Elimination of for loops
L=2; T=1; w0=2*pi; N=3; % Any t as you like without restriction t = linspace(0,L*T,500); l = floor(t / T); dt = mod(t...

3 månader ago | 0

Answered
Does the base Matlab have something similar to Java's command 'setDefaultCloseOperation'?
https://fr.mathworks.com/help/matlab/creating_plots/define-an-object-deletion-callback.html

3 månader ago | 0

Answered
Does the latest version of MATLAB support fmincon with gpuarray?
Discuss recently about this limitation of optimizer functions, no currently they won't support GPU array.

3 månader ago | 1

| accepted

Answered
"uigetfile" only opens the matlab drive, not local file explorer
uigetfile open a file browser controller by the operating system. Usually user can navigate whereever he is allowed and in the ...

3 månader ago | 0

Answered
Why is the derivative of a matrix not of the same order?
I guess you mistaken between numerical finite difference https://fr.mathworks.com/help/matlab/ref/diff.html and symbolic deriv...

3 månader ago | 0

Answered
In my code the parfor is slower than for loop when using backslah with matrices.
There is no problem. There might be no benefit to run parfor on function that is designed with multithread and already exploit...

3 månader ago | 5

| accepted

Answered
Count the number of times a particular sequence occurs in the vector.
Not for-loop but it does the job A=randi(0:1,1,10) spattern = [0 1]; startidx = strfind(A,spattern)

3 månader ago | 0

Answered
Determine the number of elements in succession in a vector that are equal in a succinct way
You can use many runlength in filesubmission. I use here my own; x = [4 4 4 4 4 1 1 1 1 1 1 2 2 2 2 2 2 2 4 4 4 4 4 4 4] [le...

3 månader ago | 0

| accepted

Answered
Vectorisation to replace for loop: Steganography text hiding
Second take: d = nan(numel(px),1); d(LSB===0) ) = 1; d(LSB===1) ) = -1; d(LSB==binaryTxt) = 0; b = isfinit(d); pxk = px(is...

3 månader ago | 0

Answered
Best Practice: Many Functions relying on Global Variables?
May be a little cumbersome but for serious application and when I'm not lazy, I define a subclass UniversalParameterClass of Sin...

3 månader ago | 1

Answered
Find a number and range of group of the same number
A= [1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 1 1 2 2 1 1 3 3 3 3 3 1 1 1 2 2 2 ]; [u,~,G]=unique(A); n = length(u); for g=1:n i = f...

3 månader ago | 0

Answered
How to fit a data to a model without using Statistical Toolbox?
Polynomial fits can be done with linear algebra, no fminsearch is required, but yeah clearly the model cannot fit data with thre...

3 månader ago | 2

Answered
Null space solutions in the presence of noise
You can call [x_lsq ,a] = eigs(@(x) (S'*S)\x, size(S,2), 1, 'smallestabs') where S is your (sparse) matrix sqrt(a) is the sma...

3 månader ago | 0

Answered
problem with scatteredInterpolant: are there any limits?
You'll have problem anyway since your data is not centered and especially not normalize. x range is 130 and y range is 1155688,...

3 månader ago | 1

Answered
Solving an implicit equation in matlab
D=1/(V-b) is a root of fifth order polynomial, where the coefficients depend on P, T, etc... It looks like it is small non-line...

3 månader ago | 0

Answered
Solving an implicit equation in matlab
The numerical answer is -0.284179329144572 format long -(17211847986098922057056496272843303410021431145154622943954950247403...

3 månader ago | 0

Answered
Creating curved alpha hull, similar to R-package
Just plot the boundary as concave. Some time it doesn't work since the vert returned are not in order, I don't know why and coul...

3 månader ago | 1

Answered
Is it possible to find the limit as a function approaches a complex number?
If seem that what you want can be derived from the the Laurent series of G about p_i I have no idea if Matlab symbolc can compu...

3 månader ago | 1

Answered
How do I calculate the correlation between the rows two large matrices?
Just use the formula of correlation % Fake data for testing A = rand(10,5); B = rand(10,5); Ac = A - mean(A,2); Bc = B - ...

3 månader ago | 0

| accepted

Answered
How to generate uniformly distributed points inside the volume of frustrum with base radius R and tip radius r and with a height of h.
Here we go r = 1; R = 2; % must be > r h = 3; if R <= r error('Non valid parameter') end Zmin = r*h/(R-r); % Posi...

3 månader ago | 0

| accepted

Answered
solving nonlinear equation including max function
The dumb method (buts surely reliable and give all possible solution) is to assume one of the 4 combinations rhs max in (1) is ...

3 månader ago | 0

Answered
While loop not breaking even though condition is met.
Just guessing; Might be it breaks but your function is entered again or there are many instances of function in queue, log more ...

3 månader ago | 1

| accepted

Answered
Applying boundary conditions on a cubic spline interpolation
You can use my function spline1d available here https://fr.mathworks.com/matlabcentral/fileexchange/24996-spline-derivative?s_ti...

3 månader ago | 0

Answered
Generate random numbers with truncated Pareto distribution
According the https://en.wikipedia.org/wiki/Pareto_distribution the pareto has bounded on the lower side by what they called xm...

3 månader ago | 0

Answered
inpolygon usage with big matrices or faster function
Try this https://fr.mathworks.com/matlabcentral/fileexchange/27840-2d-polygon-interior-detection?s_tid=srchtitle At some point ...

3 månader ago | 0

| accepted

Answered
2 vectors compare it
A=[2 3 4 5 10 7 15 9 16 12 17 18 19 20]; [As,is] = sort(A(:)); col = 1 + (is>size(A,1...

3 månader ago | 0

Answered
fminunc : A VERY STRANGE PROBLEM!
Just shooting in the dark here and wonder if you let the UseParallel option of fminunc to true or false? It could be that the ...

3 månader ago | 0

Answered
Can we Generate a Random Matrix with No Repeated Elements
Just the reshape long vector returned by randperm m = 3; n = 2; A = reshape(randperm(10,m*n), m, n)

3 månader ago | 0

| accepted

Load more