Community Profile

photo

Bruno Luong


Last seen: Today
1,115 total contributions since 2009

Bruno Luong's Badges

  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • Revival Level 1
  • Thankful Level 2
  • Guiding Light
  • 6 Month Streak
  • Knowledgeable Level 4
  • First Answer
  • Speed Demon
  • Solver

View details...

Contributions in
View by

Answered
Wrong Hessian output in fminunc
I guess the hessian is estimated from BFGS formula, that needs more than 1 FMINCUNC iteration. In you case the minimum is reache...

2 hours ago | 0

Answered
Undefined function 'ne' for input arguments of type 'table'.
Filefolder = find(table2array(Folderlinks)~="")

4 hours ago | 0

Answered
y = randsample(population,k)
TMW never mentions it officially, but it's Fisher-Yates shuffle algorithm (source https://uk.mathworks.com/matlabcentral/answe...

5 hours ago | 0

Answered
Standard deviation for a field inside a field?
arrayfun(@(s) std(s.BO.circle), structarray)

8 hours ago | 1

| accepted

Answered
find indicies of maximum and minmum elements of an array in its each segmented smaller arrays, plus mean
Test example A=1:100; indexA=[8 16 30 37 43 48 66 71 76 81 86 91 97]; Code I = zeros(siz...

1 day ago | 1

| accepted

Answered
spline with non monotonic axis
t = 0:100; x= sin(0.2*t); y = cos(0.6*t); ti=linspace(min(t),max(t),1000); xi = spline(t,x,ti); yi = spline(t,y,ti); plo...

1 day ago | 0

Answered
find minumum indices of one array in another array
A= [ 47 100 153 207 261 314 368 422 474 527 581 635 687 741 794 847 900 954 1007 1060]; B=[3...

1 day ago | 0

Answered
Accessing Elements in a 3D matrix using Linear Indexing ?
Given sz = [m,n,p] ans linidx is the linear index of an element, here is one way of computing the subindexes (row, col, page). T...

1 day ago | 0

| accepted

Answered
Create surface consisting of two implicitly surfaces
"Can anyone help me with this question?" Not clear to me what exactly is the question. If you have two implicit equations for ...

1 day ago | 0

Answered
interpn vs griddata: how are results different?
Mathematical, in short the difference is INTERPN uses tensorial linear function on nd-hypercube that enclose the query point. ...

2 days ago | 0

Answered
Usage of structure as input of a function. Is it efficient ?
"I've struggled to find ressources online about that matter (maybe I didn't find the right keywords" No, it's not your fault, T...

2 days ago | 3

| accepted

Answered
Find/return value from each row in a big matrix that corresponds with a condition/value
"Let me specify, I only want the first time the value appears in each row and if the value dont appear I want closest value." T...

2 days ago | 0

Answered
Convert subscripts to linear indices with dynamic matrix size
% Generate random array of nd-indexes sz=[3 4 5 6]; m = 10; n = length(sz); SUBIDX=ceil(sz.*rand(m,n)); % Method 1, with ...

3 days ago | 1

| accepted

Answered
Vectorize a code involving multiple loops commands
x = [0:0.1:10]; a=[2 1; 0.5 0.25]; b=[500 200; 300 250]; c=[0.25 0.35; 0.15 0.25]; d=[0.5]; X = reshape(x,1,1,[]); AB = ...

3 days ago | 1

| accepted

Answered
Conditional Random number generation
m = 5; n = 3; s = 10; This will generate uniform distribution with sum criteria % generate non-negative integer random (m x ...

3 days ago | 0

Answered
Rounded random numbers with fixed sum
k = 3; r = (diff([0 sort(randperm(100+k-1,k-1)) 100+k])-1)/100

3 days ago | 0

Answered
mex-file crashes MATLAB in for loop
Those are wrong, you should not Free the pointers that you are not Malloc. mxFree(a_double); mxFree(b_double); mxFree(z_do...

3 days ago | 1

| accepted

Answered
C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.
If you have a decend C-compiler you might use my MEX MERGE SORTED ARRAY c = mergesa(a,b); % or mergemex(a,b); c = c([true; dif...

3 days ago | 1

| accepted

Answered
Recover matrix Z from XZX', Z es symmetric and n-by-n, while X is k-by-n where n>>k
You can't getback to 27x27 covariance matrix Z after reducing it it on 5 dimensional space (by X). The information lost forevver...

4 days ago | 0

Answered
solve A*X=B containing very large or small elements
Work with unitless system, scale your matrix, or use automatic scaling if you don't want to bother.

4 days ago | 0

| accepted

Answered
How do I shift columns (left or right) in a matrix
k > 0 shift right k < 0 shift left A*diag(ones(1,size(A,2)-abs(k)),k)

4 days ago | 0

Answered
How to solve the equation of binary logic operation, where all unknowns are 0 or 1
[x1,x2,x3,x4,x5,x6]=ndgrid(0:1); x1 = x1(:); x2 = x2(:); x3 = x3(:); x4 = x4(:); x5 = x5(:); x6 = x6(:); b = [x1+x2+x3+...

5 days ago | 0

Answered
Finding the most orthogonal set of n vectors from dataset of unit vectors
I propose this % random test A, which represents 100 normalized vector in R^5 n = 5; m = 100; A = randn(n,m); A = A ./ sqrt...

5 days ago | 0

Answered
EVALIN cannot execute a return?
Yes it is written in the doc. From EVALIN/EVAL document page "evalin(workspace,expression) ... expression — Expression to ev...

5 days ago | 1

| accepted

Answered
Matrix compare and unkonw relationships to find
Use regression methods. If you have a linear/affine model, then use linear algebra. If you have "kind" non-linear, use polynomia...

5 days ago | 0

Answered
Why is memory reduced for an identical copy of a sparse array?
Nah nothing to do with name length, it's the number of internal non zeros of ('Ir" and "Pr" old notation) array reserved by MATL...

5 days ago | 1

| accepted

Answered
(Block-) Matrix multiplication inaccuracy
Same problem, don't count on exact associativity when working with floating point arithmetics. I can quote word-to-word from wha...

6 days ago | 0

| accepted

Answered
Reshape n-th dimension of an array
You operation makes the array changing its size, you can't use for-loop to store the rotated page in the SAME arrray. And btw f...

6 days ago | 1

| accepted

Answered
Curl, Divergence calculation from velocity data
Your data is already gridded, no need to gridded on top of it load('matlab.mat') UU=reshape(data(:,3),[75 62]); VV=reshape(...

6 days ago | 0

Answered
Checking a matrix for duplicates in specific row, removing the respective columns
d= [1 2 2 3 4 5 6 6 7; 1 2 3 4 5 6 7 7 8] dd = diff([nan,d(1,:),nan])==0; remove = dd(1:end-1) | dd(2:end) x_cut = uni...

7 days ago | 0

| accepted

Load more