Community Profile

# Bruno Luong

##### Last seen: Today
1.642 total contributions since 2009

View details...

Contributions in
View by

How to select complementary elements from a vector?
d = [33 20 4 5 6 75 8 9 0]; I = [1 3 7]; d(I) = []

ongeveer 10 uur ago | 0

How to select complementary elements from a vector?
d = [33 20 4 5 6 75 8 9 0]; I = [1 3 7]; d(setdiff(1:end,I))

ongeveer 11 uur ago | 0

Matlab equivalent of rand() in C++
random4 = randi(item)-1

4 dagen ago | 0

| accepted

Multiple griddata calls into a single one (same grid)
For nearest/linear/cubic method you can build the matrix https://www.mathworks.com/matlabcentral/fileexchange/85939-mat-op-ex, f...

4 dagen ago | 0

Multiple griddata calls into a single one (same grid)
If you are ready to trade 'v4' method for something else, you can use scatteredInterpolant % example of fake data x = -3 + 6...

4 dagen ago | 0

Passing structs/objects to functions
"Does the compiler realize which parts of the struct are actually needed and pass only these to the function? " MATLAB don't pa...

5 dagen ago | 0

| accepted

Smallest number of data type single
>> realmin('single') ans = single 1.1755e-38 >>

5 dagen ago | 0

How to remove redundant elements in a sparse matrix?
E = triu(E);

7 dagen ago | 1

xs=cumsum(ceil(10*rand(1,10))) t=pi; p=cumsum([0 ceil(diff(xs)/t)]); xq=interp1(p,xs,0:p(end))

8 dagen ago | 0

| accepted

Non-convex shape as a collisionBox for robot path planning
The MATLAB probably use GJK algorithm that requires convex shape. You should split the object in sum of convex. I can recommend...

8 dagen ago | 0

Fast implementation of max-plus matrix multiplication
function C = mp_prod(A,B) m=size(A,1); n=size(B,2); AA=reshape(A,m,1,[]); BB=reshape(B.',1,n,[]); C=max(AA+BB,[],3); tic/t...

8 dagen ago | 2

Preallocating cells with unknown output size
If the size is not known, a good way is the to grow the preallocation array exponentially. Rather than the assigment X{i,j} =...

9 dagen ago | 0

| accepted

Size mismatch error on dimension 2: expected 1, but actual size is 3 (Matlab Coder)
Size of ones(SimCoreIn(k).Ns,SimCoreIn(k).Np) = 102 x 3 So (102 x 1).*(102 x 3) gives (102 x 3) right. Right but cod...

10 dagen ago | 0

| accepted

Why the sparse pattern of a sparse matrix changed
The mex probably creates a non-valid sparse matrix, use spok to check validity

10 dagen ago | 1

| accepted

continuous piecewise linear approximation of data set

11 dagen ago | 0

App does not execute properly unless in debug mode [R2020b]
May be you should add drawnow so as things get refresed app.run.Enable='off' drawnow

11 dagen ago | 0

Calling script from a function is recommended?
Inconvenience: MATLAB coder cannot work on script inside function

11 dagen ago | 0

Question

Calling script from a function is recommended?
Now and then I call script from a function, the purspose is often initialize some constant values that are shared by across the ...

11 dagen ago | 2 answers | 0

### 2

How to speed up this for loop containing kronecker product?
Yesterday I profile your code and the majority of time is eaten by H = K_D*K_D' - K_S*K_S'; not by Kronecker. The question is...

12 dagen ago | 0

svds(X,r) and svd(X,'econ') generating different singular vectors for large complex matrix X ??
The singular value (eigen) decomposition SVD/SVDS is not unique, vectors is up to scaling, (values is up to order for eigen valu...

12 dagen ago | 1

| accepted

How to find the first element in ascending numbers that repeat?
A = [1 2 3 4 0 1 0 1 0 1 0 1 2 3 4 0 1 0 1 0 1 1 2 3 4] b = find(A(1:end-1)==1 & diff(A)>0)

13 dagen ago | 0

Calculating a matrix with a specific form
There might be a better mehod, at least more geometric, than linear system solving. I understand you want to find m (3 x 1) suc...

13 dagen ago | 2

How to select complementary elements from a vector?
>> d(~ismember(d,I)) ans = 2 5 6 8 9 0

13 dagen ago | 1

Vectorization of Weighted Minkowski Distance
[n,m] = size(X); % do not use length Xi = reshape(X,[n,1,m]); Xj = reshape(X,[1,n,m]); tt = reshape(theta,[1,1,m]); Mat2 = s...

14 dagen ago | 0

| accepted

How to find the first number, ignore subsequent until a greater number repeats.
A = [ 0 3 0 3 0 3 0 3 0 4 0 4 0 4 0 4 0 5 0 5 0 5 0 5 0 5 0 3 0 3 0 3]: b = find(A==3); c = diff(b); b([1 find(c>c(1),1,'firs...

14 dagen ago | 1

| accepted

Assignment of variables by comma separated lists
Use deal >> A = struct('number', cell(1, 5)); >> A A = 1×5 struct array with fields: number >> n=1:5; >> c...

14 dagen ago | 0

High level question: use Matlab Compiler to integrate a function.m into C++ code
You need Compiler SDK to build shaed library Compiler alone can compile only to standalone app

14 dagen ago | 1