Réponse apportée
Fmincon failure in optimizing an objective function which includes determinant of a matrix.
Make sure your objective function returns real numerical output Nr=4;No=1; N = 4; h = sqrt(0.5)*(randn(N,N)+1i*randn(N,N)); ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
EASY QUESTION ABOUT THE lsqlin COMMAND: Is it possible to use the lsqlin algorithm for MIMO systems (always with linear constraints)?
As long as you have a linear least-squares model, linear equality and inequality constraints then yes you can use lsqlin, as cl...

plus de 3 ans il y a | 0

Réponse apportée
A very fast way to find elements and their indices? (Is ismember fast?)
You overly complicate your code for nothing, and yes ismember if fast. Not sure if your a is always single element or just in t...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
A very fast way to sort datetime (in "ascend" mode)?
The first peak is due to JIT that is not kicks in. Here is the result on my PC (code attached) I have to chase what create t...

plus de 3 ans il y a | 0

Réponse apportée
How can I derive inverse of the matrix with infinite determinant?
"Is there way to compute the inverse of the matrix A?" No. The sum of all columns of your matrix A is numerically 0, therefore...

plus de 3 ans il y a | 2

Réponse apportée
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...

plus de 3 ans il y a | 3

Réponse apportée
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; ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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

plus de 3 ans il y a | 0

Réponse apportée
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.

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
"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 ...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 5

| A accepté

Réponse apportée
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)

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 1

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 2

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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,...

plus de 3 ans il y a | 1

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
Solving an implicit equation in matlab
The numerical answer is -0.284179329144572 format long -(17211847986098922057056496272843303410021431145154622943954950247403...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 2

Réponse apportée
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...

plus de 3 ans il y a | 1

Réponse apportée
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 - ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 3 ans il y a | 0

Réponse apportée
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 ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Charger plus