Community Profile

photo

Bruno Luong


Last seen: Today Active since 2009

Statistics

All
  • 24 Month Streak
  • Thankful Level 4
  • Speed Demon
  • Solver
  • GitHub Submissions Level 1
  • Personal Best Downloads Level 4
  • Ace
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • Revival Level 1

View badges

Content Feed

Answered
uniform knot vector for splines
Your knot sequence seems NOT to be suitable for interpolation. The interpolation matrix is singular. x = linspace(1,6,6); xi =...

1 dag ago | 0

| accepted

Answered
Strange behavior with ODE45 dependent on tspan
I would divide the time interval in three parts, as the typical time scales are different during the pulse and outside the pulse...

1 dag ago | 0

Answered
Matrix multiplication not returning on certain matrix content (Intel)
The matrix contains many non normalized floating point numbers and operations on these numbers are very slow; >> load('C:\Users...

3 dagen ago | 0

Answered
Using fmincon to solve objective function in integral form.
trapz(tspan/length(t), 2*x.^2 + 2*xd.^2) This looks wrong to me, you seem to assume t is equi distance (even in that case you s...

3 dagen ago | 1

| accepted

Answered
Lognormal distribution parameters mu and sigma
Is mu=log(mean) and sigma=log(Standard deviation)? No: https://en.wikipedia.org/wiki/Log-normal_distribution If X is log-norma...

4 dagen ago | 0

Answered
Effficient Computation of Matrix Gradient
The best N = 200; % 750 gradX_1 = zeros(N,N); w = rand(N,N); AXB = rand(N,N)+1i*rand(N); A = rand(N,N)+1i*rand(N); B = ran...

4 dagen ago | 0

| accepted

Answered
Effficient Computation of Matrix Gradient
I propose this, and time testing for N = 200; N = 200; % 750 gradX_1 = zeros(N,N); w = rand(N,N); AXB = rand(N,N)+1i*rand(N)...

4 dagen ago | 0

Answered
fmincon solution does not differ from initial guess if I provide gradient
To get more info turn the option 'CheckGradients' to 'on', and check the exitflag (third output) of fmincon

4 dagen ago | 1

| accepted

Answered
Function matchpairs does not work in MATLAB R2023a when I use a sparse cost matrix. Please help me out ASAP!
Your sparse matrix filled default cost wit 0 not 99. Then your expectation on that the result is identocal for different cost ma...

4 dagen ago | 0

Answered
error using spline: The first input must contain unique values.
Your spline command wouldn't do what you want, since for every x you have made corresponding two y values. It is NOT a function ...

4 dagen ago | 0

Answered
error using spline: The first input must contain unique values.
You did not post your spline command, my guess is you do spline(x,y) Try to remove the last (or the first value of th, then do ...

4 dagen ago | 0

Answered
How to fit a sine curve with only the maximum and minimum values
piecewise (co)sine interpolation (not fitting). I don't think you have extra DOF to play with if you restrict data to be local ...

5 dagen ago | 1

Answered
symmetric solutions of linear matrix equations
This is a method that use the small "original" linear system. I use pcg since it a linear solver that can accept function handle...

5 dagen ago | 1

Answered
symmetric solutions of linear matrix equations
If you have tthe optimization toolbox % Generate test matrices n = 3; A = randn(n); X=rand(n); X = X+X.'; B = X*A; % Add s...

6 dagen ago | 0

| accepted

Answered
how to multiply every single element in a matrix to entire of another matrix?
x = [100,500,900,1300,1700; 120,600,1080,1560,2040; 140,700,1260,1820,2380; 160,800,1440,2080,2720; 180,900,...

6 dagen ago | 1

Answered
symmetric solutions of linear matrix equations
% Generate test matrices n = 5; A = randn(n); X=rand(n); X = X+X.'; B = A*X; % Add small noise to B B = B + 1e-1*randn(siz...

7 dagen ago | 0

Answered
polyfit step by step or analytics
polyfit is the mfile you can step through in debugging mode. If you call with one outout argument (non normalized) it build van...

8 dagen ago | 0

Answered
Inserting 0 in sparse matrices without changing sparsity pattern?
Is it possible to tell MATLAB to not change the sparse matrix, but instead treat inserted zeros as any other value? Short answ...

8 dagen ago | 1

| accepted

Answered
How to fix my linear fit model?
Assuming you know where to split the data for left and right lines: x = [0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 ......

8 dagen ago | 1

| accepted

Answered
How to fix my linear fit model?
This returns the piecewise linear function that is continuous at the break point. The correct break point is close to 18.6054 a...

10 dagen ago | 1

Answered
strcmp gives a 0 while it should be a 1
Look more carefully: There is a 'c' before '49' in A but not in B

11 dagen ago | 0

| accepted

Answered
Basic FFT Question: What range to sample the function in.
" However I am under the impression that the fft should not be sensitive to this change. " Your expectation in incorrect When y...

15 dagen ago | 0

| accepted

Answered
getfield to get values from an entire struct array?
Create 1 x 3 struct array with field named 'afield' s = struct('afield', {11 12 13}) s(1) s(2) s(3) % Here is the command t...

15 dagen ago | 0

| accepted

Answered
express basis spline derivative in terms of interpolation values
x = [1 2 3 4 5]; y = randn(size(x)); k = 5; f = spapi(k,x,y); B = spapi(k,x,eye(length(x))); fdd = fnder(f, 2); Bdd = ...

16 dagen ago | 0

| accepted

Answered
Use MATLAB Coder to convert matlab code to mex without using multi-threading
https://www.mathworks.com/help/coder/ug/use-parallel-for-loops.html

18 dagen ago | 0

Answered
How to get all possible combination With the total number of possible combination for "n" variables that can take different values
Checkout similar thread https://www.mathworks.com/matlabcentral/answers/476022-how-to-pick-up-all-combination-of-numbers-from-m...

19 dagen ago | 0

| accepted

Answered
Possible issues with solving iterative linear systems with mldivide
"Is there a way to see the matrix solver steps to see which expressions might have an issue?" No they are LAPACK/BLAS based cod...

19 dagen ago | 0

Answered
Sparse matrix vector product returns null.
"What can cause this issue?" Nothing. What you claim likely would not happen. Unless if you show an example.

19 dagen ago | 0

| accepted

Answered
How to define if/else non linear constraint in an optimization problem
Simply solve three different optimization pbs with the three repectively constraints independently and ignore the two other, the...

19 dagen ago | 1

Answered
How to use loop to fill in specific numbers?
T = combinations(1:4,1:8) % for alder release that does not support combinations [v1 v2] = meshgrid(1:4,1:8); v1 = v1(:); ...

19 dagen ago | 0

Load more