已回答
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)); ...

4 years 前 | 0

| 已接受

已回答
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...

4 years 前 | 0

已回答
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...

4 years 前 | 1

| 已接受

已回答
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...

4 years 前 | 0

已回答
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...

4 years 前 | 2

已回答
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...

4 years 前 | 3

已回答
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; ...

4 years 前 | 0

| 已接受

已回答
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...

4 years 前 | 0

已回答
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

4 years 前 | 0

已回答
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.

4 years 前 | 1

| 已接受

已回答
"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 ...

4 years 前 | 0

已回答
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...

4 years 前 | 0

已回答
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...

4 years 前 | 5

| 已接受

已回答
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)

4 years 前 | 0

已回答
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...

4 years 前 | 0

| 已接受

已回答
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...

4 years 前 | 0

已回答
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...

4 years 前 | 1

已回答
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...

4 years 前 | 0

已回答
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...

4 years 前 | 2

已回答
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...

4 years 前 | 0

已回答
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,...

4 years 前 | 1

已回答
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...

4 years 前 | 0

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

4 years 前 | 0

已回答
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...

4 years 前 | 2

已回答
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...

4 years 前 | 1

已回答
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 - ...

4 years 前 | 0

| 已接受

已回答
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...

4 years 前 | 0

| 已接受

已回答
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 ...

4 years 前 | 0

已回答
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 ...

4 years 前 | 1

| 已接受

已回答
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...

4 years 前 | 0

加载更多